This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validate field