Hello All How do I de-select the radio button. Basically i have two radio buttons with the same name (same group). Once the page(form) is loaded in the browser both the radio buttons are unselected. But after the user clicks one of the radio button, that becomes enabled. Is it possible for me to programatically de-select (in the sense both the radio buttons should not appear to be selected as it was when the page was loaded). Appreciate your help.... Thanks a bunch Chandar
Hi The code below does not select any radio button. <p><input type="radio" value="V1" name="R1">Yes</p> <p><input type="radio" value="V2" name="R1">No</p> But the code below selects the 'Yes' radio button because the checked parameter has been added to the 'Yes'. <p><input type="radio" value="V1" name="R1" checked>Yes</p> <p><input type="radio" value="V2" name="R1">No</p> So if you do not add the 'checked' to any of the radio buttons, none of them will be selected when the form loads.
Chandar to do it the way you want to, in your code use this: document.formName.groupName[index].checked = false; formName is the name of the form that the two buttns are on, groupName would be the name of the two buttons you have, and index is either 0 or 1 for the first or second button. hth Dave
It's weird that we cook bacon and bake cookies. Eat this tiny ad: