Re: Number Validator

2007-08-02 Thread Rene Gielen
Since entering a NAN value for a number property should result in conversion errors, you might want to checkout this: http://cwiki.apache.org/confluence/display/WW/conversion+validator Richard Sayre schrieb: > Is there a way to use the XML validation to check to see if a field is > a number? I us

Re: Number Validator

2007-07-31 Thread Max Pimm
Using the regex field validator. This is a regular expression that tests for a positive integer, it also allows the field to be empty ^\d*$ This would be the same but not allow an empty field ^\d+$ Your field validator would look something like My field s

Re: Number Validator

2007-07-31 Thread Richard Sayre
I am using Struts 2 wich uses the com.opensymphony.xwork2.validator.validators. It does not seem to have a validator to test to see if a a value can be converted to an integer. Is there a way to write my own validator to do this work? On 7/31/07, Jorge Martín Cuervo <[EMAIL PROTECTED]> wrote: >

Re: Number Validator

2007-07-31 Thread Jorge Martín Cuervo
Hi which version of commons validator are you using? http://struts.apache.org/1.2.9/userGuide/dev_validator.html i so, you can see: integer - validates that a field can be converted to an Integer. intRange - validates that an integer field is within a specified range.

Number Validator

2007-07-30 Thread Richard Sayre
Is there a way to use the XML validation to check to see if a field is a number? I used integer to check for min and max but if I enter any text into the field it passes the validation. Thanks, Rich - To unsubscribe, e-mail: [E