Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enable Previously Disabled Radio Button

Status
Not open for further replies.

JabbaTheNut

Programmer
Jul 29, 2002
176
US
I used the following code to uncheck all radio buttons in a RadioButtonList and to disable the RadioButtonList:

//uncheck radio buttons
for (i=0; i<document.form1.radioname.length; i++) {
document.form1.radioname.checked = &quot;false&quot;;
}

//disable RadioButtonList
document.getElementById(&quot;radioname&quot;).disabled = &quot;true&quot;;

This works great. The problem is that I cannot re-enable the RadioButtonList. I have tried each of the following:

document.getElementById(&quot;radioname&quot;).disabled = &quot;false&quot;;
document.getElementById(&quot;radioname&quot;).enabled = &quot;true&quot;;

document.form1.radioname.disabled = &quot;false&quot;;
document.form1.radioname.enabled = &quot;true&quot;;

However, none of these worked. What is the proper syntax to re-enable the RadioButtonList?

Thanks in advance :)
 
Please disregard...

I was making an improper call to the javascript function that re-enables the RadioButtonList.

For those who are interested, the correct syntax was:

document.getElementById(&quot;radioname&quot;).disabled = &quot;true&quot;;

Sorry for any inconvenience :)
 
correction...

document.getElementById(&quot;radioname&quot;).disabled = &quot;false&quot;;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top