What is the best way to checking if a valid double type number “##.##” is entered in a text box? so if there is a decimal entered once, don’t let users enter it again.
Would regular expressions be the best way to do this?
Any help is much appreciated
If you are talking in terms of jQuery, there are many options out there. Most of them involves a regular expression check.
Matching against a valid number is easy enough with regular expressions, if your main concern is preventing further character insertions, read on.
All you need to do is the following.
I will assume you allow patterns that starts with a dot, as long as javascript parses it as if there is a leading zero, and many developers treat this as a short-hand.
Also with the jQuery tag, assumed that you are working with jQuery.