Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: VB VB10.0
Hello, I can't seem to find information on how to automaticly check a check box or tick a radio button when filling out a web form. What do I enter between the quotes:
("Value", "?") or am I going about this the wrong way?
theElementCollection = WebBrowser1.Document.GetElementsByTagName("checkbox")
      For Each curElement As HtmlElement In theElementCollection
          Dim controlName As String = curElement.GetAttribute("name").ToString
          If controlName = "opt-in" Then
              curElement.SetAttribute("Value", "")
          End If


Thank You, Brian
Posted 16-Nov-11 19:43pm
Edited 17-Nov-11 14:42pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You need to use the checked attribute[^] not value
Kcjoey3 at 17-Nov-11 19:50pm
Hello, thanks for the info but if I enter that in my vb program and fill out the form the check box still is not checked. Any Ideas?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 9,535
1 OriginalGriff 8,295
2 Peter Leow 4,839
3 Kornfeld Eliyahu Peter 3,210
4 Maciej Los 2,301

Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 17 Nov 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100