Solved

DELPHI: how to insert string data to input text box (web browser ) ?

Posted on 2014-10-03
3
531 Views
Last Modified: 2014-10-15
DELPHI: how to insert string data to input text box (web browser ) ?
i trying to use
 wb1.OleObject.Document.getElementById('zip_code').setAttribute('value', '90001');

Open in new window

but i got error , because the page that i want to add for it value available in iframe
Kind Regards.
0
Comment
Question by:napster matheo
3 Comments
 
LVL 25

Accepted Solution

by:
Sinisa Vuk earned 500 total points
ID: 40362524
try to iterate through iframes:
....
  frameDispatch: IDispatch;
  frame_win: IHTMLWindow2;
  frame_doc: IHTMLDocument2;
  j: OleVariant;
  Tag: IHTMLElement;
...
    for i := 0 to Doc.frames.Length - 1 do
    begin
      j := i;
      frameDispatch := Doc.frames.Item(j);
      if Assigned(frameDispatch) then
      begin
        frame_win := frameDispatch as IHTMLWindow2;
        frame_doc := frame_win.document;
        Tag := frame_doc.getElementById('zip_code');
        if VarIsNull(Tag) then
        begin
           Tag.setAttribute('value', '90001');
           Break; 
         end;
      end;

Open in new window

0
 

Author Closing Comment

by:napster matheo
ID: 40381546
Thank You , I Think it's gonna be working , Once Again Thank you
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
isEverywhere  challenge 19 64
pre4 challenge 19 88
Mobile Keyboard covers the display of the TMemo 3 66
bunnyEars challenge 6 62
Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now