|
|
To get radio button selected value using Javascript - Javascript
|
Views : 612
|
|
Tagged in : Javascript
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
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;
}
}
|
|
By Rekha, On - 2010-03-12 |
|
|
|