Solved

Clickable radio button labels for Struts

Posted on 2007-04-03
3
856 Views
Last Modified: 2013-11-24
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>
0
Comment
Question by:nateforrest1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
Kuldeepchaturvedi earned 500 total points
ID: 18847888
have a look at this..
This might help.
http://www.beernut.ca/jim/archives/002408.html
0
 

Author Comment

by:nateforrest1
ID: 18848237
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>
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 18848335
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.
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
String array comparison 4 57
How to determine if a string is a valid SHA value 7 56
intellij error 2 56
IntelliJ and Eclipse Neon 2 installations 4 66
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question