Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

requiredif Validation - Struts Client side validation

 
Sri Anand
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sri Anand
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic