Click here to Skip to main content
15,886,664 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have 2 radio button. how can keep one button by default checked
Posted
Comments
Sergey Alexandrovich Kryukov 24-Mar-14 17:39pm    
What's wrong with reading standard MSDN documentation? Reading the HTML standards will also be helpful.
—SA

You just need to provide checked="checked"

for e.g:

XML
<form id="form1" runat="server">
    <input id="rad1" type="radio" checked="checked" />
    <input id="rad2" type="radio" />
</form>



Here the first Radio button will be checked at run time whereas the second one will be unchecked
 
Share this answer
 
Look here: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.radiobutton%28v=vs.110%29.aspx[^].

Can you see the property named Checked? Any questions?

—SA
 
Share this answer
 
Hi...
C#
<input id="Radio" type="radio" checked="checked" />
<input id="Radio1" type="radio" />

Here by default 1st is checked Radio one and 2nd one is not checked one.
Thank u.
 
Share this answer
 

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