This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes Does anyone have any pre-built tags to validate contact info fields (e.g. phone, email, state ...) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Does anyone have any pre-built tags to validate contact info fields (e.g. phone, email, state ...)" Watch "Does anyone have any pre-built tags to validate contact info fields (e.g. phone, email, state ...)" New topic
Author

Does anyone have any pre-built tags to validate contact info fields (e.g. phone, email, state ...)

Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
Hi,

I'm using MyFaces 1.1.9. Can anyone point me to or share sample code that you have that creates a JSF text field for a US phone number and an email address that also validates those fields are of the right form (in the case of the phone number, I'm looking for the format "XXX-XXX-XXXX")?

Thanks, - Dave
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15959
    
  19

Check out some of the extensions tagsets like MyFaces Tomahawk and RichFaces.

Another alternative is the MyFaces Extensions Validator, which allows you to define validations in the backing bean or on the datamodel. The datamodel option has the advantage of enforcing validation going to the database regardless of where the data came from, UI or not.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Does anyone have any pre-built tags to validate contact info fields (e.g. phone, email, state ...)
 
Similar Threads
JTextField
Validating phone number and email in form
phone number formatter in struts2
Mask JTextField 1.3
AJAX and simple form validation