0
<input type="button" onclick="javascript:fnnSaveChanges()" onblur="lsTest=0" onfocus="lsTest=1" value="OK">
<input type="button" onclick="window.close()" onblur="lsTest=0" onfocus="lsTest=2" value="Cancel">
</td>
<td class="clsTableElement" align="right" nowrap=""> Selecting 'Save' in the Main Window is required to Save the new settings. </td>

i've tried

WebBrowser1.Document.All.GetElementsByName("OK")(0).InvokeMember("click")

but i get


value of 0 is not valid for index. index should bebetween 0 and -1.

I tried -1 same thing

please help, thanks.

3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by thines01
0

We do something similar where we use the first set of code (modified for your scenario). If the first set works, try the second set too.

Dim okButton As HtmlElement = WebBrowser1.Document.GetElementById("OK")
  okButton.InvokeMember("click")

And

WebBrowser1.Document.GetElementById("OK").InvokeMember("click")
0

Do you actually need to "click the button" or do you need the function "fnnSaveChanges()" to run?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.