开发者

How to get Index of the FORM Element in the WebBrowser Control?

开发者 https://www.devze.com 2023-03-17 18:04 出处:网络
let say a site has 2 forms: one search form and the other is a registratio开发者_Go百科n form...

let say a site has 2 forms: one search form and the other is a registratio开发者_Go百科n form...

<form>
Search: <input type="text" name="s">
<input type="hidden" name="a" value="search">
<input type="submit" value="Search">
</form>

[..]website content blabla[...]

<h2>Registration</h2>
<form>
E-Mail: <input type="text" name="email">
<input type="hidden" name="a" value="reg">
<input type="submit" value="Register">
</form>

If I submit a form, I want to know to which form the clicked submit button belongs. GetElementbyId is not possible because the id is not always available. I want to get the index. Any ideas? (WebBrowser Element in VB.NET or C#)


You cant refer to Form object of Input Element e.g btn.Form.Name should work; give it a try

http://msdn.microsoft.com/en-us/library/aa703812(v=vs.85).aspx (reference to IHTMLInputElement::form Property)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号