Click here to Skip to main content
12,823,954 members (45,920 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 19:43pm
Updated 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 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
Web01 | 2.8.170308.1 | Last Updated 17 Nov 2011
Copyright © CodeProject, 1999-2017
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