This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

validate for negative number

 
Nakata kokuyo
Ranch Hand
Posts: 472
  • 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