Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: requiredif Validation - Struts Client side validation