Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 02-27-2009, 04:24 AM
kim_ray kim_ray is offline
Member
 
Join Date: Aug 2007
Posts: 58
Default Fill html Input Elements on a Web Form and Submit programatically

hi
i am submit a web page form by programing

this is my html page code "www.abcd.com"

Code:
      



i have a delphi form and form have a Twebbrowser component ad have button on button click form should be fill and then submit automatically

Code:
procedure TForm1.Button1Click(Sender: TObject);

begin

end;
kim_ray
Reply With Quote
  #2  
Old 02-27-2009, 06:54 AM
develyoy develyoy is offline
Senior Member
 
Join Date: Nov 2007
Posts: 628
Default RE: Fill html Input Elements on a Web Form and Submit programatically

try this:[DELPHI]uses MSHTML;

procedure TForm1.Button1Click(Sender: TObject);
var
doc:IHTMLDocument2;
frm:IHTMLFormElement;
fld:IHTMLInputTextElement;
begin
doc:=WebBrowser1.Document as IHTMLDocument2;
frm:=doc.forms.item('login_form',EmptyParam) as IHTMLFormElement;
fld:=frm.item('username',EmptyParam) as IHTMLInputTextElement;
fld.value:='someone';
fld:=frm.item('password',EmptyParam) as IHTMLInputTextElement;
fld.value:='something';
frm.submit;
end;
[/DELPHI]
Reply With Quote
  #3  
Old 02-14-2011, 11:48 AM
ployo60 ployo60 is offline
Junior Member
 
Join Date: Jan 2011
Posts: 2
Default

What if I don't know the name of the form (in your example: 'login_form'). Is there a way of finding out the name of the form from the id code. So it would be like tracing back which form the id belongs too?


fld.frm for example? do you know how I could work that? thx
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 10:47 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.