This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

validate for negative number

 
Nakata kokuyo
Ranch Hand
Posts: 467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi , how to we validate a number that should not contain negative number in validator ?

thanks in advance !
 
MInu
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi...

use this in your validation.xml

<field property="propertyname" depends="required,integer,intRange">

hope this would help
 
alan do
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can also use 'validwhen' if you're using struts 1.2.x and do a test for >= 0
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic