<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 class="clsTableElement" align="right" nowrap=""> Selecting 'Save' in the Main Window is required to Save the new settings. </td>

i've tried


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.

Recommended Answers

All 4 Replies


pretty please?

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")



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

Be a part of the DaniWeb community

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