Forums

Diferents between Digits and Numbers validation ?

Mushr00m 29 Apr, 2010
Hello everybody !

I just need for one of my form to have a field with digits only "0123456789" so I tried to use the digits-only validation, but it accept the dot "." ....
So I tried the numbers-only and it does exactly the same, so can someone explain me the diference between digits-only and numbers-only validation ? And maybe how to accept just digits "0123456789" ?

Thanks a lot !
GreyHead 08 May, 2010
Hi MushRr00m,

Digging in the LiveValidation code it looks as though the [url=http://www.w3schools.com/jsref/jsref_parseInt.aspJavaScript parseInt()[/url] function is used to test integers and the test will be passed for e.g 9.00 as well as 9 :-( (but not 9.001).

You might need to use a Custom validation to get what you need. There's an example in this post and a few others in the forums.

Bob
This topic is locked and no more replies can be posted.