Click here to Skip to main content
12,295,457 members (57,592 online)
Rate this:
 
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 18:43pm
Kcjoey3349
Edited 17-Nov-11 13: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 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160525.2 | Last Updated 17 Nov 2011
Copyright © CodeProject, 1999-2016
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