One commonly known disadvantage of radio buttons is that after a button in a group is selected, it is impossible to remove the selection from the groupat least one button is always selected from then on. With a little bit of JavaScript, this effect can be mitigated by offering a JavaScript button or link that removes the radio button selection. The preceding code iterates over the radio button group and sets the checked property of all elements to false (complete code in the file emptyradio.html). Tip This issue can also be solved by HTML alone: Just offer a radio button (selected by default) that stands for "no selection," in the following fashion: <input type="radio" name="answer" value="Y" />yes <input type="radio" name="answer" value="N" />no <input type="radio" name="answer" value="" checked="checked" />no answer Of course, you would then also have to change any validation code. |