'<form action="" method="post">
    '<fieldset>
     '   	<ul>
    '		<li>
    	'		<input type="text" name="username" id="user"/>
    	'	</li>
    	'	<li>
     	'		<input type="password" name="pass" id="pass"/>
    	'	</li>
    	'	<li>
    	'		<input type="submit"  name="submit" value="submit"/>
    	'	</li>
	'	</ul>	
    '</fieldset>
'</form>

Above is a php form that has refused to be submitted by my code below

'...
If WebBrowser1.Url.AbsoluteUri = "http://www.site1./file1.php" Then
            WebBrowser1.Document.GetElementById("username").SetAttribute("Value", "username")
            WebBrowser1.Document.GetElementById("pass").SetAttribute("Value", "password")
            WebBrowser1.Document.Forms(0).InvokeMember("submit")
'...

Where could the error be in my code?

I have solved my own problem several days later. Hopes it helps someone several years later.

I don't know the reason why the line of code below does not work with the php form above. I guess noone else knows. It, however, works with several other forms.

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

The single line below solves my(our) problem

WebBrowser1.Document.GetElementById("submit").InvokeMember("click")
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.