[Logo]
Forums Register Login
Amout validation
hi,
how do i validate amount field not to accept characters ?
 

Originally posted by Mary Cole:
hi,
how do i validate amount field not to accept characters ?



you can create a validator , or look for one around that validates for numbers
You don't have to do anything extra. If the field on the form is bound to a numeric data type on the backing bean, the validation is done for you. If you type a character in the field you will get a conversion error message. Something like this: Specified value is not a valid number.
Hope this helps.
Additional you may additional add a validate constraint. In IBM jsf, this is what I do.

<hx:validateConstraint regex="^-?\d+(\.\d{2})?$" />

This thread has been viewed 1396 times.

All times above are in ranch (not your local) time.
The current ranch time is
Sep 24, 2018 07:05:01.