Categories




PreviousNext
To get radio button selected value using Javascript    
 Send mail Views:229
Belongs to : Javascript
Facebook Bookmarkbookmark this page Digg Bookmark Delicious BookmarkStumbleupon Bookmarkshare with orkut Post to Google Buzz

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:

1
2
3
4



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;
}
}


Pictures and Videos
Online Calculators
embed code


By - Rekha, On - 2010-03-12
Send This
PreviousNext

User Comments


Add NEW Feedback:

Name :     Email :

 Server Monitoring Web hosting by Hiox India Privacy Policy Terms and Conditions