WebBrowser / Submitting A Form
I am having trouble submitting a form with my program which is using the WebBrowser control.
Code:
WebBrowser.Document.All("follow").InvokeMember("click")
I tried this but it did not work. The result is that the WebBrowser displays "This program cannot display the webpage" error page. The problem I think, is that the page is using javascript when it comes to submitting the form.
This is the code for the submit button:
Code:
<input type="button" onclick="submitIt()" value="Follow" name="follow"/>
And this is the javascript for the onclick="submitIt()"
Code:
function submitIt(){
document.formx.submit();
}
So how can I submit this form? Is there any way to invoke that javascript submitIt() method through VB.net? Or am I missing a better way to do this?
Re: WebBrowser / Submitting A Form
Nobody has any ideas on this?
Re: WebBrowser / Submitting A Form
You shouldn't name your controls as their classes.
Code:
WebBrowser.Document.All.Item("follow").InvokeMember("click")
Re: WebBrowser / Submitting A Form
Try navigating webbrowser with a javscript :P
Code:
javascript:document.formx.submit();
Or
Code:
javascript:document.formx.submit()
Re: WebBrowser / Submitting A Form
You could try this code:
Code:
Webbrowser1.Document.GetElementById("follow").InvokeMember("Click")