aspose file tools
The moose likes JSF and the fly likes How to prevent values over 99inches but still allow 13.5 inches 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 "How to prevent values over 99inches but still allow 13.5 inches" Watch "How to prevent values over 99inches but still allow 13.5 inches" New topic
Author

How to prevent values over 99inches but still allow 13.5 inches

Dan Acuff
Ranch Hand

Joined: Jul 13, 2009
Posts: 62
I am tasked with preventing someone from entering in 120 into the following three inputText boxes.
But they still have to be able to enter i.e. 13.5 inches.

How would I go about doing this? I do not even know where to start.

Roma Datta
Greenhorn

Joined: Jun 26, 2010
Posts: 3
if i understand your problem right, you can do this.



SCJP
Open Source is the world!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14480
    
    7

I'm not quite sure what you're asking here. If you prevent values over 99 inches, why is 13.5 inches a special case worth mentioning? Is that you really mean than only values between 0 and 99.9 or so are allowed?

If so, a converter isn't what you need. You need a RangeValidator. Basic JSF stuff.

If you're ambitious, you can also attach JavaScript to the controls to limit things on the client side, but even then I'd recommend putting range validation on your input controls.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
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: How to prevent values over 99inches but still allow 13.5 inches
 
Similar Threads
problem on saving inputText values
<hx:inputHelperAssist> not working
How do I validate if an input box contains alphanumeric characters?
Clear validation message dynamically for the Datepicker
How to dynamically set panel header on a condition using <f:facet