Disable Radio Button Groups Onload
General
This unobtrusive script will disable groups of radio buttons on the page if one radio button is checked. It works with multiple groups and multiple forms on one page. Buttons are disabled on a group-by-group basis. Easy to use!
Notes
- Created by: Greg Burghardt
- Web Site: WebDeveloper.com Forums
- Posted: August 24, 2007
Source Code
Paste this source code into the designated areas.
External file
Paste this code into an external JavaScript file named: disableRadioButtons,js
Head
Paste this code into the HEAD section of your HTML document.
Body
Paste this code into the BODY section of your HTML document


Leave a Response
(6 comments)You would need to rewrite the script to do that.
This is really cool... but I was wondering if something like this could be done 'onchange' instead of 'onload' with set(s) of radio buttons of my desire. (I think that's what the other 2 users (that commented here) wanted too.[br /][br /]For example, on your questions, if the first questions was:[br /]"Will you attend the national event?"[br /]If the 'No' radio button is selected then 2nd question: "Are you a member?" stays disabled, however if they answer 'Yes' then the 2nd radio set of questions become available.[br /][br /]Make sense?
As I mentioned to John above, it is for additional information when you don't want the user changing the original question.
This is supposed to be used when additional information is required and you don't want the user changing the original question.
I don't get it. The first group of radio buttons are always disabled. What use are they?