Hi,
I have a problem with the Struts nested radio buttons. I can't get the value out of the radio buttons.
The code is similar to the following. I don't have the access to the original code right now, but the logic is the same.
<html:html>
<script language="javascript">
function submitForm(){
alert( document.form.option.value );
}
</script >
<body>
<nested:form action="/formAction" name="form">
<nested:radio property="option" value="AAA"/> Some label A
<nested:radio property="option" value="BBB"/> Some label B
<nested:radio property="option" value="CCC"/> Some label C
<nested:submit property="submit" value="Submit" onclick="submitForm();"/>
</nested:form>
</body>
</html:html>
I have defined the "option" property in the form. The problem is that, when I click on the Submit button, the javascript alert always shows "undefined". It does not retrieve the radio button's values such as AAA, BBB or CCC. I do not want to define the radio buttons in an iterative way.
Could anyone help to point out where the problem is? How can I retrieve the value when a radio button is selected? Sorry I couldn't find a solution, because most of the posts are talking about iteration with radio buttons.
Thank you.