Why do people still include JavaScript code to validate data when using an input type="date" ? This input displays the calendar, which should ensure that a proper date is used.
Why do people still include JavaScript code to validate data when using an input type="date" ? This input displays the calendar, which should ensure that a proper date is used.
In addition to being able to better control the format of the date that the user is going to put and then manage it well in your code, you also have to take into account what browsers you are developing for , and obviously put warnings in case you do not support those old browsers.
In the case of type=date:
More information about browsers that do not support it:
https://caniuse.com/#feat=input-datetime
Sometimes it is to detect the regional zone and thus be able to restrict the use of that website, or also to record the current data of your computer and compare them with those of the server so that there is no type of fraud, as Google does on devices mobiles. If you don't have the correct time and date on your mobile, Google doesn't let you do some things that have to do with Android and the PlayStore.