This really has nothing to do with ZF, but here you go:
The radio buttons get numeric indexes in the order of their definition. so
if I had those radio buttons:
<form id="testform" method="post" action="#">
<input type="radio" name="gender" value="male" /> male
<input type="radio" name="gender" value="female" /> female
</form>
I'd use this javascript code:
if (document.getElementById("testform").gender[0].checked == true) {
// "male" was selected
}
else {
if (document.getElementById("testform").gender[1].checked == true) {
// "female" was selected
}
else {
// none was selected
}
}
Best regards
Tobias
PS: Please use google first the next time.
2008/7/22 Rohit83 <[EMAIL PROTECTED]>:
>
> Hi I am writing javascript and in that tring to fetch the value of radio
> button options when submit button is clicked,but unable to figure out how i
> can do that? will anybody suggest the way?
> Regards
> Rohit
> --
> View this message in context:
> http://www.nabble.com/javascript-and-radio-button-value-tp18587212p18587212.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>