To get radio button selected value using Javascript
by Rekha[ Edit ] 2010-03-12 18:12:12
In order to get the value of a radio button using JavaScript, we need to loop through all the radio buttons in that set and then find out the value of the radio button which is checked.
Example:
You have to use the following code to retrieve radio button selected value,
for (var i=0; i < document.frm.choice.length; i++) {
if (document.frm.choice[i].checked) {
var radiovalue = document.frm.choice[i].value;
break;
}
}