Everyone knows that a credit card number is normally made up of 12-16 numbers.
However there are many ways that people type their number into a form, often including spaces or hyphens to break up the number and make it more readable.
In the ECMAScript specification, they only exist conceptually: All numbers are always floating point and integers are ranges of numbers without decimal fractions (for details, consult “Integers in Java Script” in “Speaking Java Script”).
Here user can enter either phone number or mobile number. Here user can enter either 10 digit number(which starts from 9) OR can enter 8 digit number(starts with 2).
This function first determines the ASCII code of the keyboard key and then verifies that its ASCII code is within the range 48 to 57.
Also it makes sure that the key pressed is not an special key like Backspace or Delete, if yes then that too is excluded Hi, This is Mudassar Khan. Net Question Answer site, specially started to allow visitors of this site ask their doubts and queries. Just click the Ask Now button and ask your question now.
Now you can ask questions directly to me on my new site ASPForums.
Remember it is always necessary to validate form input values using a server-side script to cater for non-Java Script browsers or exploit attempts.