Question: If there is only one radio button for a form, your Validating Radio Button script will not work.
Please let me know how to fix it.
Answer: Having one radio button by itself doesn't make any sense. You are in effect asking a question that only has one answer. Since a question needs at least two possible answers to be worth asking you need at least two radio buttons to be able to select between those answers.
If the two answers are yes/no or true/false then it is often easier to use a single checkbox rather than two radio buttons (it then depends on the script processing the answer). This means that there will usually be at least three answers (and therefore three buttons) for most questions where radio buttons are used.
The only use I can think of for one radio button by itself is where you have a question that has more than one answer but you want to tell your visitors what the only acceptable answer is by having just the one radio button that is already selected. Since you can't unselect a radio button without selecting a different radio button within the same group and there are no other buttons in the group there is no need for any script processing to validate a single radio button.
Explanation of Question: Thanks very much for your reply.
<input type="hidden" value="" name="myradiobutton" />
<input type="radio" value="1st value" name="myradiobutton" />1st<br />
Just make sure that the hidden field has the same name as the radio button group that you want to validate and comes first so that the radio button overrides the value of the hidden field when the form is posted. Additional radio buttons would be inserted after these two lines.
This article written by Stephen Chapman, Felgall Pty Ltd.