View Full Version : How to Validate only for Numbers

24 Jun 2009, 8:30 PM
I have a TextField in which i want to allow the user to enter only Numbers and Decimal point. Kindly tell me how do this.

25 Jun 2009, 8:48 AM
Two solutions:
(1) Use NumberField which extends TextField and is meant to only allow entry of numbers. There are some nice methods to set the format with this.
(2) Use a validator with the TextField (why if we have a NumberField) - the problem here, is the validator is only called I believe if the field is requird? (not sure on this).

I would go with NumberField.