|
-
Jul 29th, 2002, 12:37 PM
#1
Thread Starter
Member
RadioButtonList and JavaScript
In my ASP.Net page, I have implemented a RadioButtonList server control with id="txtCreditType". The HTML that is rendered by the control is as follows:
<table id="txtCreditType" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;">
<tr>
<td>
<input id="txtCreditType_0" type="radio" name="txtCreditType" value="Individual" />
<label for="txtCreditType_0">Individual</label>
</td>
<td>
<input id="txtCreditType_1" type="radio" name="txtCreditType" value="Joint" /><label for="txtCreditType_1">Joint</label>
</td>
</tr>
</table>
I would like to uncheck both of the radio buttons on the client-side (leaving nothing checked). I will then disable the control. This is part of a client-side clean-up procedure. I do not have a problem disabling the control in javascript (that seems to work great). However, I cannot uncheck either of the radio buttons. I think it may be a syntax issue.
Could someone please provide the appropriate method for unchecking both of the radio buttons?
Thank you in advance.
-
Jul 29th, 2002, 04:54 PM
#2
Thread Starter
Member
I found the answer at another forum. Come On Folks!
To uncheck the radio buttons, you can use the following function:
function uncheckRButtons() {
for (i=0; i<document.formname.radioname.length; i++) {
document.formname.radioname[i].checked=false;
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|