aspose file tools*
The moose likes Struts and the fly likes Validate field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validate field" Watch "Validate field" New topic
Author

Validate field

Tmmet Johnson
Ranch Hand

Joined: Nov 03, 2004
Posts: 56
Hi,
Is there a way in Struts to validate a field , only, if it has a value?
I have a Email id field which I want to validate only if the user enters a value in that field,if not, I don't want it to validate.
Could anyone let me know how this can be done?
Thanks,
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

In the validation framework all validations only run when a value is entered by default (other than the "required" validation of course). You do not need to do anything special.

If you are not using the validation framework you can simply skip validation when a field's value is null or empty string.


A good workman is known by his tools.
 
Don't get me started about those stupid light bulbs.
 
subject: Validate field