Need Help - "click" submit on web page using VB Web Browser control
Need Help - "click" submit on web page using VB Web Browser control
Need Help - "click" submit on web page using VB Web Browser control
Need Help - "click" submit on web page using VB Web Browser control
Need Help - "click" submit on web page using VB Web Browser control
Need Help - "click" submit on web page using VB Web Browser control Need Help - "click" submit on web page using VB Web Browser control Need Help - "click" submit on web page using VB Web Browser control Need Help - "click" submit on web page using VB Web Browser control Need Help - "click" submit on web page using VB Web Browser control Need Help - "click" submit on web page using VB Web Browser control Need Help - "click" submit on web page using VB Web Browser control Need Help - "click" submit on web page using VB Web Browser control
Need Help - "click" submit on web page using VB Web Browser control Need Help - "click" submit on web page using VB Web Browser control
Need Help - "click" submit on web page using VB Web Browser control
Go Back  Xtreme Visual Basic Talk > > > Need Help - "click" submit on web page using VB Web Browser control


Reply
 
Thread Tools Display Modes
  #1  
Old 05-19-2003, 05:34 PM
SamWitney SamWitney is offline
Newcomer
 
Join Date: May 2003
Posts: 4
Question Need Help - "click" submit on web page using VB Web Browser control


Hi...

I need some help, I need to make the VB Web Browser "click" a submit button on a page. I would normally submut data by appending onto the end of the "URL - http://www.thesiteinquestion.com/page?x=123&y=234", however in this case i need to actually click the button, as it submits a random code, which even the variable name is random - some kind of hash on the PHP SES ID.

I know this is possiable, in the past I have found code that will input text to fields on a page (in WebBrowser) and then submit the page. Sadly, after about 2 hours searching on VBCode.com I still cant find it!!!

Can anyone help me? Im really desperate for the code... ASAP

Many Regards,

Sam

vbhelp@samwitney.co.uk
Reply With Quote
  #2  
Old 05-19-2003, 07:18 PM
robot313's Avatar
robot313 robot313 is offline
Senior Contributor

Retired Leader
 
Join Date: May 2001
Location: USA
Posts: 1,295
Default

WebBrowser1.Document.Forms("formname").buttonname.Click
Reply With Quote
  #3  
Old 05-20-2003, 05:29 AM
SamWitney SamWitney is offline
Newcomer
 
Join Date: May 2003
Posts: 4
Default Thanks... but

Hi,

Thanks for that code, I was just goin to try it but found the form on the site does not have a name! There are 3 forms on the page, all name less... is there anyway I can program arround this?

Sam
Reply With Quote
  #4  
Old 05-20-2003, 09:07 AM
Aspen2K's Avatar
Aspen2KNeed Help - "click" submit on web page using VB Web Browser control Aspen2K is offline
Contributor

Retired Leader
* Expert *
 
Join Date: Jan 2001
Location: Ohio
Posts: 717
Default

No matter what the name, if it is a submit button it will get clicked here.

This is for a single form
Code:
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant) For i = 0 To WebBrowser1.Document.Forms(0).length - 1 Debug.Print WebBrowser1.Document.Forms(0)(i).Name & " " & WebBrowser1.Document.Forms(0)(i).Type If WebBrowser1.Document.Forms(0)(i).Type = "submit" Then WebBrowser1.Document.Forms(0)(i).Click End If Next i End Sub
This is for Multiple forms on the webpage
Code:
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant) 'loop forms For x = 0 To WebBrowser1.Document.Forms - 1 'loop items in form For i = 0 To WebBrowser1.Document.Forms(x).length - 1 'print out the name and type of the item on the form Debug.Print WebBrowser1.Document.Forms(x)(i).Name & " " & WebBrowser1.Document.Forms(x)(i).Type 'if it is a submit button, click it If WebBrowser1.Document.Forms(x)(i).Type = "submit" Then WebBrowser1.Document.Forms(x)(i).Click End If Next i Next x End Sub
hth,
Aspen2K
__________________
A man is a success if he gets up in the morning and gets to bed at night,
and in between does what he wants to do. - Bob Dylan

Vb code does not go through spell check very well - Me
Reply With Quote
  #5  
Old 05-25-2003, 12:23 PM
SamWitney SamWitney is offline
Newcomer
 
Join Date: May 2003
Posts: 4
Default Thanks

Thanks - i just checked the forum... many thanks for your help!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to submit FORM from VB app 2 ASP page HarishD Web Programming 9 08-22-2003 02:47 AM
control of web browser in VB suman_kk Communications 1 05-20-2003 05:11 AM
MS Explorer - Web Browser Control internationally General 1 09-12-2002 10:21 AM
QB to VB Conversion - By AIO BillSoo Tutors' Corner 0 08-06-2002 11:37 AM
How can I scroll a web browser control in VB? Sampson General 6 08-18-2001 09:51 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Need Help - "click" submit on web page using VB Web Browser control
Need Help - "click" submit on web page using VB Web Browser control
Need Help - "click" submit on web page using VB Web Browser control Need Help - "click" submit on web page using VB Web Browser control
Need Help - "click" submit on web page using VB Web Browser control
Need Help - "click" submit on web page using VB Web Browser control
Need Help - "click" submit on web page using VB Web Browser control Need Help - "click" submit on web page using VB Web Browser control Need Help - "click" submit on web page using VB Web Browser control Need Help - "click" submit on web page using VB Web Browser control Need Help - "click" submit on web page using VB Web Browser control Need Help - "click" submit on web page using VB Web Browser control Need Help - "click" submit on web page using VB Web Browser control
Need Help - "click" submit on web page using VB Web Browser control
Need Help - "click" submit on web page using VB Web Browser control
 
Need Help - "click" submit on web page using VB Web Browser control
Need Help - "click" submit on web page using VB Web Browser control
 
-->