Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: VBVB10.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 18:43pm
Edited 17-Nov-11 13: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 686
1 OriginalGriff 498
2 Tadit Dash 420
3 sanket saxena 337
4 Zoltán Zörgő 230
0 Sergey Alexandrovich Kryukov 11,800
1 OriginalGriff 7,225
2 Peter Leow 5,009
3 Abhinav S 3,893
4 Maciej Los 3,575

Advertise | Privacy | Mobile
Web02 | 2.8.140421.2 | Last Updated 17 Nov 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid