0

I have a problem invoking a submit method in web page

This is my code

Webbrowser.document.forms(0).invokemember("submit")

It does nothing.

Here is the html

<form name="myWebForm" action="myServerSideScript.php" method="post"> 
    <input type="checkbox" /> Checkbox 1<br /> 
    <input type="text" /> Text Field 1<br /> 
    <input type="submit" value="SUBMIT" /> 
</form>
4

1 回答 1

1

您必须将 .AllowNavigation 属性设置为“TRUE”

Webbrowser.AllowNavigation = True

并像这样调用提交方法

Webbrowser.Document.Forms(0).InvokeMember("submit")

或者

Webbrowser.Document.Forms.GetElementsByName("myWebForm").Item(0).InvokeMember("submit")
于 2013-03-17T00:10:53.403 回答