• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic