Validating date in java script
The relevant portions of the HTML are as follows: .
In this example, the date fields will only accept input that matches the pattern 'dd/mm/yyyy' (this could just as easily be changed to 'yyyy-mm-dd' or 'mm/dd/yyyy').
below is the code for validating mobile number with enter only numeric, length must be 10 digits and restrict user to entering illegal characters.
This script only confirms that the input format is correct and that each individual value falls within its allowed range.
It does not check for leap years or invalid dates at the end of short months.