However, this still allows erroneous input such as 39/19/1999 (where 39 is days and 19 is months).
I cant find a solution anywhere! All the date masking Ive found allow any numbers to be inputted, so mine is a little more strict, but still not enough. Any ideas?
The mask also accepts a callback, so you could set the day/month/year as values of a date object and then check if the date object still contains what you expect.
be aware, that US visitors may enter the date as mm/dd/yyyy out of habit (and even reject the possibility that dd/mm/yyyy would be a date format at all).
It’s tempting to use the placeholder to clue people in to the format, but the placeholder is not guaranteed to appear and so isn’t a good place to show important information like that.
Placing the date format information beside the date entry field is recommended.