Forum Moderators: open
HTML:
<input type='radio' name='model' value='0'> Black
<input type='radio' name='model' value='1'> Red
<input type='radio' name='model' value='2'> Green
Javascript:
form.model.value //gives undefined
form.model.value[0] // gives 0
form.model.value[1] // gives 1
...
But How do I get the current set value for 'model', to know which, if any of the buttons, has been clicked? What I want to know is if they have clicked any of them. Is the only way to check each for 'checked'?
for loop. for(1 = 0; i < document.forms[0].model.length; i++) {
if(document.forms[0].model[i].checked == true) {
alert("Option number " + i + " is selected");
}
}