Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am trying to have a webpage load into the web browser control in C# and I need all the radio boxes to already be set to no. I dont know how to tell the program to select those radios that are in the webpage and to then select yes or no to them.
How can I select those radios in the webBrowser control? using c Sharp

here is my code

<input type="radio" name="browser" value="IE" checked>
Internet Explorer<br>

<input type="radio" name="browser" value="Mozilla">
Mozilla<br>

<input type="radio" name="browser" value="Opera">
Opera<br>
Posted
Updated 9-Feb-11 21:01pm
v2
Comments
Shahriar Iqbal Chowdhury/Galib 10-Feb-11 3:05am    
use jquery

1 solution

Use the checked attribute:
<input type="radio" name="browser" value="IE" checked="true"></input>


See here for explanation: W3Schools[^]

You can't have all the radio boxes set to "no": that isn't how radio buttons work. One of them is always set to true.

If you need a case when none of them are checked, either add a "None" Radiobox, or convert them to checkboxes instead of radio.
<input type="checkbox" name="browser" value="IE">Internet Explorer<br>
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 10-Feb-11 10:53am    
Simple as that, a 5.
--SA

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900