Click here to Skip to main content
Rate this: bad
good
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
Kcjoey3349
Edited 17-Nov-11 14:42pm
v3

1 solution

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

Solution 1

You need to use the checked attribute[^] not value
  Permalink  
Comments
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 DamithSL 315
1 Zoltán Zörgő 170
2 OriginalGriff 150
3 Sergey Alexandrovich Kryukov 120
4 Maciej Los 115
0 OriginalGriff 7,760
1 DamithSL 5,874
2 Sergey Alexandrovich Kryukov 5,444
3 Maciej Los 5,076
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 17 Nov 2011
Copyright © CodeProject, 1999-2014
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