Link to home
Start Free TrialLog in
Avatar of nateforrest1
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>
ASKER CERTIFIED SOLUTION
Avatar of Kuldeepchaturvedi
Kuldeepchaturvedi
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nateforrest1
nateforrest1

ASKER

Thanks!  Although the page you referred me to went to extremes that were not necessary for my application, I was reminded of the 'styleId' attribute for the tag.  

Here is what worked for me:

<html:radio styleId="chicago" property="CITY" value="Chicago"><label for="chicago">Chicago</label></html:radio>
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.