This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Validation question

 
Ranch Hand
Posts: 42
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

can someone tell me how to validate the following using struts...

1) date field should be greater than a particular date
eg: dateOfBirth should be greater than 10/10/1980

2) a field should accept values from a closed set of values
eg: sex should be either Male or Female

3) one of the 'N' number of fields are mandatory
eg: there are three fields called txnRef, suite, email. User
should enter atleast one of these three values.

appreciate any help on these questions..
thanks in advance
Jim.
[ December 30, 2005: Message edited by: Jim Patrick ]
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You never mentioned if you are using the validation framework. Are you writing code for your ActionForms' validate method or are you setting up validations with the framework in validation.xml?
 
Jim Patrick
Ranch Hand
Posts: 42
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Marc Peabody:
You never mentioned if you are using the validation framework. Are you writing code for your ActionForms' validate method or are you setting up validations with the framework in validation.xml?



Hi Marc,

yes i am using the validation framework..and setting up validations with framework in validations.xml. can u provide me some validation examples for my questions pls..


Rgds,
Jim
[ December 28, 2005: Message edited by: Jim Patrick ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!