Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to press a button in a TWebbrowser when there are multiple buttons on page. Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
Press button on TWebbrowser when there is mutilple buttons. 20-Apr-04
Category
Internet / Web
Language
Delphi All Versions
Views
457
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
Aradi, Hamza
Reference URL:
Hamza
			1   
2   // If there is only one button, you can do something like: 
3   
4   WebBrowser1.OleObject.Document.forms.item(0).elements.item(0).click; 
5   
6   // This will do a click on the first element of the first <FORM>, where an 
7   // element is either <INPUT>, <SELECT> or <TEXTAREA>. 
8   
9   
10  // If there is more than one button, you can do something like: 
11  
12  procedure TForm1.Button1Click(Sender: TObject); 
13  var  
14    ovElements: OleVariant;  
15    i: Integer;  
16  begin  
17    ovElements := WebBrowser1.OleObject.Document.forms.item(0).elements;  
18    for i := 0 to (ovElements.Length - 1) do 
19      if (ovElements.item(i).tagName = 'INPUT') and 
20        (ovElements.item(i).type = 'SUBMIT') and 
21        (ovElements.item(i).Value = 'Recent Charges') then 
22        ovElements.item(i).Click;  
23  end; 
24  


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC