I have a WebBrowser control where I want to edit a field in the HTML and then submit a form. Let's say that the field is called txtUname
and that the submit button is called submit
in form form1
. How can I do this?
I'm currently thinking of using something like this, but I haven't tested it:
//Change value
webBrowser1.Document.getElementbyId("txtUname").setAttribute("value","this is my value");
//Submit form
webBrowser1.Document.Forms("form1").invokeMember("submit");
In addition, does this work for any type of field?
Also, is it possible to do something similar inside a WebClient?