Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…

920 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

16 Experts available now in Live!

Get 1:1 Help Now