File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes requiredif Validation - Struts Client side validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "requiredif Validation - Struts Client side validation" Watch "requiredif Validation - Struts Client side validation" New topic
Author

requiredif Validation - Struts Client side validation

Sri Anand
Ranch Hand

Joined: Mar 06, 2005
Posts: 392
I am trying to validate 2 fields conditionally and using the requiredif in validator.xml but validation happens on Server side and not on client side, I noticed there is no corresponding method in validation rules xml file.

Does that mean i cannot use to do the client side validation are there any alternatives ?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The requiredIf and validWhen rules do not support client-side validation. This means that if you want client-side validation for these fields, you will have to write your own JavaScript code to perform the validation.


Merrill
Consultant, Sima Solutions
Sri Anand
Ranch Hand

Joined: Mar 06, 2005
Posts: 392
Thanks Merill for the reply. if any one has such routines pls provide me i can get an idea to write my own
Sri Anand
Ranch Hand

Joined: Mar 06, 2005
Posts: 392
merrill or any one Can help point to some example how to write custom Java script which can be generic like other supported validation. OR do we have any scripts already available ?
[ June 29, 2007: Message edited by: Raghunandan Mamidala ]
Sri Anand
Ranch Hand

Joined: Mar 06, 2005
Posts: 392
Does any one have idea if the later versions of struts has javascript support for requiredif and valid when I am working on stiff deadlines no time to research .., badly looking for help
Sri Anand
Ranch Hand

Joined: Mar 06, 2005
Posts: 392
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: requiredif Validation - Struts Client side validation
 
Similar Threads
javascript object how to retrieve properties
What happened to the scaffold BaseAction?
Validation in Struts
Error handling in Struts
validating forms