Clicking class button on website
<p>I have the following code for a webpage;</p>

<pre><code>&lt;div class="toolbox"&gt;
&lt;div class="toolboxNest" align="left"&gt;
&lt;div class="clear"&gt; &lt;/div&gt;
&lt;div class="gap"&gt; &lt;/div&gt;
&lt;label for="j_username"&gt;
&lt;input id="j_username" type="text" name="j_username"&gt;
&lt;div class="clear"&gt; &lt;/div&gt;
&lt;div class="gap"&gt; &lt;/div&gt;
&lt;label for="j_password"&gt;
&lt;input id="j_password" type="password" name="j_password"&gt;
&lt;/div&gt;
&lt;div class="clear"&gt;&lt;/div&gt;
&lt;div class="gap"&gt;&lt;/div&gt;
&lt;div align="center"&gt;
&lt;input class="formButtonGreen" type="submit" value="Login"&gt;
&lt;/div&gt;
&lt;div class="clear"&gt;&lt;/div&gt;
&lt;div class="gap"&gt;&lt;/div&gt;
&lt;div class="infoText"&gt;
</code></pre>

<p>I am able to click and enter text for the username and password, but I cant work out how to press the submit button, if it were just an element then that would be fine, but it's in a class and I'm unsure how to do it.</p>

<p>This is my code...</p>

<pre><code>var x = webBrowser1.Document.All.GetElementsByName("j_username");
  x[0].InnerText = "xxxxx";
  var y = webBrowser1.Document.All.GetElementsByName("j_password");
  y[0].InnerText = "xxxxxxxx";

//This part is not working....
 var s = webBrowser1.Document.GetElementById("formButtonGreen");
  s[0].InvokeMember("click");
</code></pre>

<p>Any one got any ideas?</p>

<p>Please note: I don't own the website so can't make changes to code behind webpage...</p>

<p>Thanks, </p>

<p>David</p>
