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
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
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:
>
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.
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
5 matches
Mail list logo