Monday, 6 February 2017

JavaScript code to validate dates in dd/mm/yyyy format

Hi all,

Here is a JavaScript function that I developed in order to validate whether the entered date is correct when they are entered in the dd/mm/yyyy format:



There are a few validations like start year, leap year (when it is a multiple of 100) that have not been performed assuming that the dates entered will be between 1950 and 2100. However, they can also be added if required. Let me know if you have any comments on the code or have any suggestions.
Thanks!