Solved

Clickable radio button labels for Struts

Posted on 2007-04-03
3
848 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
  • 2
3 Comments
 
LVL 19

Accepted Solution

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

Author Comment

by:nateforrest1
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
copyEndy  challenge 15 54
return in catch statement 1 39
Unable to start eclipse ? 17 82
Groovy:unable to resolve class error 2 28
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…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now