Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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 ...
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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

Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 19725
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!