For example, we have a text field that must include only decimal numbers ( numbers containing "." ). If the user enters a number without a dot ( "." ), it is ok. But if
he/she enters one with a dot ( e.g. 1212.??? ), we must prevent the user from entering a second dot.
Here is the code...
For example, we have a text field and want users to enter
only digits.
The function is triggered with "onKeyUp" action and starts
to check the characters if they are digits or not.As soon as
it finds a non-digit character, it removes the rest of the text and updates the text field's value...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.