Solved

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

Posted on 2014-10-03
3
579 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 26

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How To Loop - Python 19 88
Controlled Assessment GCSE - desperate help needed 4 87
Sending files from  idTcpServer Socket to idTcpClient 2 40
enhance the following code 3 32
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

803 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