[RESOLVED] Using webbrowser form control by name - Question
Hi Everyone,
I am loading a form in the webbrowser control for the user to check boxes base don their needs. Now I need to read them for values, etc. I was shown how to loop through all of the controls and then for each one do something with. That's not a problem. What I was wondering is if I already have the name of a checkbox control such as chkOne and chkTwo, with code how can I refer to these to get the properties such as checked, value, etc. from without having to loop through and find them?
Thanks!
Re: Using webbrowser form control by name - Question
I'm not sure I understand whether your checkboxes are part of your VB form or web page?
If they are standard VB controls on the form then providing parent form name in front of control name is what you need [I guess]:
Form2.Check1
Form2.Check2
... and so on ...
Re: Using webbrowser form control by name - Question
Use the getElementById function of the Document object.
debug.Print WebBrowser1.Document.GetElementById("chkOne").Value
Add a reference to the MS HTML Object Library to your project. You will then have intellisense and can easily find out the different DOM functions available.
Re: Using webbrowser form control by name - Question
Thanks bruce! Sorry Rhino, it is the checkbox in the html code of the webbrowser control, not a checkbox on the form. I may have not explained it well.
Checking off resolved!
Warren