nateforrest1
asked on
Clickable radio button labels for Struts
I have a Struts application with a form that has a radio button group. A typical radio button on this form looks like this:
<html:radio property="CITY" value="New York"> New York</html:radio>
I'd like to make the label for the radio button clickable, however the Struts API does not allow setting an ID for <html:radio> tag. Has anyone been able to get this to work in their Struts app? Here is an example how non-Struts apps would create a clickable label:
<input type="radio" id="male" name="gender" />
<label for="male">Male</label>
<html:radio property="CITY" value="New York"> New York</html:radio>
I'd like to make the label for the radio button clickable, however the Struts API does not allow setting an ID for <html:radio> tag. Has anyone been able to get this to work in their Struts app? Here is an example how non-Struts apps would create a clickable label:
<input type="radio" id="male" name="gender" />
<label for="male">Male</label>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
yup! I thought that it will work.. but I was not too sure... as I am not very good at struts..
but I am glad that it worked for u.
but I am glad that it worked for u.
ASKER
Here is what worked for me:
<html:radio styleId="chicago" property="CITY" value="Chicago"><label for="chicago">Chicago</lab