[Help]Check a Box[Solved]

Posts 17 of 7 · Page 1 of 1
[Help]Check a Box[Solved]
how do u check a checkbox on a webbrowser.

Code:
<input id="agree_cbox" class="input_check" type="checkbox" value="1" name="agree_to_terms"/>
[php]
WebBrowser1.Document.Forms.Item(0).GetElementsByID ("agree_cbox").Item("autologin").SetAttribute("che cked", "-1")
[/php]

Hope this helps, let us know

Edit, Modified code slightly, if you tried, try it with this one.

I used this way on my account generator.
[php] Dim HElement As HtmlElement
HElement = WebBrowser1.Document.GetElementById("agree_cbox")

HElement.SetAttribute("checked", "true")[/php]
Code:
Webbrowser1.Document.GetElementById("").Focus
Sendkeys.Send(" ")
Quote Originally Posted by Blubb1337 View Post
Code:
Webbrowser1.Document.GetElementById("").Focus
Sendkeys.Send(" ")
Try my method, it's working for unchecking/checking, if you need something more complicated you should use mj's code.
Code:
 Dim HElement As HtmlElement 
            HElement = WebBrowser1.Document.GetElementById("agree_cbox") 

            HElement.SetAttribute("checked", "true")
This is MJLover code, it works but when I try to uncheck the checkbox it doesn't work.
the function
Code:
 Dim HElement As HtmlElement 
            HElement = WebBrowser1.Document.GetElementById("agree_cbox") 

            HElement.SetAttribute("checked", "false")
checks the checkbox like the one before mentioned.

Help? Thanks.
Works P E R F E C T L Y! Thank you
Posts 17 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?