Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21237

[RESOLVED] WebBrowser Question

$
0
0
I'm using WebBrowser to send a request to my website via HTML. In the following HTML code I have to click on the Submit button to send the request.

How can I change this to do the same thing without clicking on button?

Code:

Private Sub Command1_Click()
 WebBrowser1.Document.write "<html>"
 WebBrowser1.Document.write "<body>"
 WebBrowser1.Document.write "<form action='http://www.mywebsite.com/cgi-bin/processdata.cgi' method='get'>"
 WebBrowser1.Document.write "<input type='text' name='Data1' value='123456789'><br>"
 WebBrowser1.Document.write "<input type='text' name='Data2' value='9999'><br>"
 
 '
 ' Need to do same without having to click on button
 '                                        |
 WebBrowser1.Document.write "<input type='submit' value='Submit'>"
 WebBrowser1.Document.write "</form>"
 WebBrowser1.Document.write "</body>"
 WebBrowser1.Document.write "</html>"
End Sub


EDIT:

I cannot use WebBrowser_DocumentComplete to auto click on button because it does not fire the event until after the button has been clicked.

Just a thought. Is there an API that can make the button click?


EDIT EDIT:

BTW: It doesn't need to be HTML as I posted; it can be Winsock if anyone knows how to send GET, PUT, POST requests to a CGI script.

Viewing all articles
Browse latest Browse all 21237

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>