Posted By

stancell on 08/12/08


Tagged

radio


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

brent-man
wizard04
jamesming


Get radio button input value


 / Published in: JavaScript
 

  1. /**
  2.  * Example. return radioValue(form['radioName'])
  3.  */
  4. function radioValue(radioNodeList) {
  5. for (var i = radioNodeList.length - 1; i > -1; i--) {
  6. if (radioNodeList[i].checked) {
  7. return radioNodeList[i].value;
  8. }
  9. }
  10. return false;
  11. }

Report this snippet  

You need to login to post a comment.