A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
validate for negative number
Joined: Apr 13, 2005
May 09, 2005 23:35:00
hi , how to we validate a number that should not contain negative number in validator ?
thanks in advance !
Joined: Oct 09, 2003
May 10, 2005 10:55:00
use this in your validation.xml
<field property="propertyname" depends="required,integer,intRange">
hope this would help
God Gave Me Nothing I Wanted<br />He Gave Me Everything I Needed<br /> - Swami Vivekananda
Joined: Apr 14, 2005
May 10, 2005 12:57:00
you can also use 'validwhen' if you're using
1.2.x and do a
for >= 0
-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
It is sorta covered in the
JavaRanch Style Guide
subject: validate for negative number
Struts 2 + validate int value.
WA #1.....word association
random numbers, returns a negative number?
Having trouble writing a method that factors negative numbers.
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013