| Author |
Message |
|
|
Post subject: Spring <form:checkbox> validation
Posted: Aug 18, 2010 - 08:54 PM
|
|
Joined: Feb 01, 2010
Posts: 15
|
|
Hi,
The followingcode is piece of my Jsp file. Here there are five values for the checkbox and one of the value out of 5 is NO. So if the user checked the NO checkbox then rest of the 4 checkboxes should be disabled. Nothing but toggle on/off. I'm sending as list of values thru Map.add("adverseEvents","list of values from table") to JSP form. But eventsMap is Set variable inside my XXXXEditForm.java file. If No is not selected then user can able to select more than one value (ie they can check more than one checkbox).The following code is working fine ie the user can select morethan one check box. but i don't know how to make it work if user choose "NO". Among of the five values one of the item is other, so if user choose other then i need to show a textbox for user input, that is also working fine.
Any help would be appreciated.
Thanks in Advance.
<tr>
<td><spring:message code="adverseEvent"/>:</td>
<td>
<table border="0">
<c:forEach var="ae" items="${adverseEvents}">
<tr>
<td width="10"><form:checkbox path="eventsMap['${ae.integerValue}']" /></td>
<td>${ae.stringValue} <c:if test="${ae.settingName=='OTHER'}"><form:input path="eventsNotesMap['${ae.integerValue}']" /></c:if></td>
</tr>
</c:forEach>
</table>
</td>
</tr> |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: Spring <form:checkbox> validation
Posted: Aug 19, 2010 - 10:16 AM
|
|
Registered Member

Joined: May 18, 2009
Posts: 1532
|
|
Chitra,
This looks more like a logical issue.
The only resolution that I can think of is using java script to restrict the user on the client side. This can be done by adding onclick events to your check boxes.
Please refer to the following link for further reference -
http://forum.springsource.org/archive/index.php/t-44460.html |
_________________ Shalini
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Aug 19, 2010 - 04:30 PM
|
|
Joined: Feb 01, 2010
Posts: 15
|
|
Hi Shalini,
Thank you so much. Yes, you are right , it is more of logical issue. I'll follow the link and try to solve. Since i'm new to this spring Framework, it's taking more time for me to do as i don't have much. That's y i posted it here.
Thanks,
Chitra. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Aug 23, 2010 - 06:10 AM
|
|
Registered Member

Joined: May 18, 2009
Posts: 1532
|
|
Chitra,
Hope that the link will help you with the issue.
Do let us know if you have any issues. |
_________________ Shalini
MyEclipse Support
|
| |
|
|
|
 |
|
|
| |