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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I disable Radio Buttons???

Status
Not open for further replies.

JohnnyBGoode

Programmer
May 1, 2002
76
CA
This will disable a checkbox:
document.FormName.CheckboxName.disabled = true;

This will disable the 3 occurences of a radio button:
document.FormName.RadioButtonName[0].disabled = true;
document.FormName.RadioButtonName[1].disabled = true;
document.FormName.RadioButtonName[2].disabled = true;

Is there a way to disable a set of radio buttons without having to do it for each different value? Is there a way to do it similar to:
document.FormName.RadioButtonName['all'].disabled = true;

I have already tried that, but it doesn't work. What is the correct syntax to accomplish this?

Thanx in advance.


 
If you enclose the relevant radio buttons in a form then you could say:

document.FormName.elements.disabled=true
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top