This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validation for ensuring that entered value contains alphabet only

 
Adnan Gondal
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!
How can i make sure at conversion and validation phase during the JSF lifecycle that entered value in <h:inputText> contains alphabets only?
Thanks in advance.
 
Guy deLyonesse
Ranch Hand
Posts: 200
Eclipse IDE Java Ubuntu
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Write a custom validator and use a regex to check the input.

Something like this:





 
Tim Holloway
Saloon Keeper
Pie
Posts: 17625
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I may be wrong, buy I believe there already is a regex-based standard validator. So writing a custom validator shouldn't be necessary.
 
Guy deLyonesse
Ranch Hand
Posts: 200
Eclipse IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I know in JSF 1.2 there's only the required, numeric range (doubles or ints) and string length standard validators.

I don't know about JSF 2.0.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic