I want to get the selected value from a group of radio buttons.
Here\'s my HTML:
directly calling a radio button many times gives you the value of the FIRST button, not the CHECKED button. instead of looping thru radio buttons to see which one is checked, i prefer to call an onclick
javascript function that sets a variable that can later be retrieved at will.
which calls:
var currentValue = 0;
function handleClick(myRadio) {
currentValue = myRadio.value;
document.getElementById("buttonSubmit").disabled = false;
}
additional advantage being that i can treat data and/or react to the checking of a button (in this case, enabling SUBMIT button).