How to auto submit javascript form
<p>There is a search button a a webpage : </p>

<pre><code>&lt;td&gt;&lt;table border="0" cellpadding="0" cellspacing="0"&gt;&lt;tr&gt;&lt;td dir="ltr" width="10" height="21"&gt;&lt;img src="/global/images/ButtonLeftDove.gif" border="0" alt="" height="21" width="10" /&gt;&lt;/td&gt;&lt;td height="21" align="center" valign="middle" class="ButtonDove" nowrap="nowrap"&gt;&lt;a href="javascript:__doPostBack('mobjTemplate$ctl01$btnSearch2','')" onmouseover="window.status='Search';return true;" onmouseout="window.status='';return true;"&gt;Search&lt;/a&gt;&lt;/td&gt;&lt;td dir="ltr" width="10" height="21"&gt;&lt;img src="/global/images/ButtonRightDove.gif" border="0" alt="" height="21" width="10" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;
</code></pre>

<p><strong>it is calling a javascript function javascript:__doPostBack('mobjTemplate$ctl01$btnSearch2','')</strong></p>

<p>the java function is as following:</p>

<pre><code>function __doPostBack(eventTarget, eventArgument) {

    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {

        theForm.__EVENTTARGET.value = eventTarget;

        theForm.__EVENTARGUMENT.value = eventArgument;

        theForm.submit();

    }

}
</code></pre>

<p>I need to auto click that search button. </p>

<p>I tried this code but it does  not work:</p>

<pre><code>HtmlElementCollection elemColl2 = null;
HtmlDocument doc = webBrowser.Document;
elemColl2 = doc.GetElementsByTagName("form");

foreach (HtmlElement elem in elemColl2)
            {
                elem.InvokeMember("submit");
            }
</code></pre>

<p>How can I do that??</p>

<p>Thanks for help in advance..</p>
