This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSF and the fly likes Validation for ensuring that entered value contains alphabet only Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Validation for ensuring that entered value contains alphabet only" Watch "Validation for ensuring that entered value contains alphabet only" New topic
Author

Validation for ensuring that entered value contains alphabet only

Adnan Gondal
Ranch Hand

Joined: Apr 30, 2011
Posts: 32
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

Joined: Apr 12, 2011
Posts: 189

Write a custom validator and use a regex to check the input.

Something like this:





Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14480
    
    7

I may be wrong, buy I believe there already is a regex-based standard validator. So writing a custom validator shouldn't be necessary.


Customer surveys are for companies who didn't pay proper attention to begin with.
Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 189

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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Validation for ensuring that entered value contains alphabet only
 
Similar Threads
How to restrict data in JTextField?
Reset of JTextField data
Limits of Validator Framework
html:error to print specific error
Validate field