Post Date: 12/06/2018
Last Updated: today at 1:37 AM
Hello all!
I ran into an interesting situation with dates yesterday. Our users had mistyped a seemingly valid date. Since we didn't have client side validation the bad date was passed to the server and ultimately the database. This failed thankfully. In an effort to prevent something like this happening in the future we devised the JavaScript solution seen below.
The following dates were entered by the user, 1213/2018 and 12130/2018. These values were passed to the database where the error was caught.
https://codepen.io/wboka/pen/LXKVLb
Wayne
Website Development by Wayne Boka, Web Developer
© 2020-2023 Wayne Boka, All Rights Reserved