I want to create different inputmasks like Date Input mask in Javascript.
What will be the best way to create masks. (Without any Framework!)
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Attach an event listener to the onKeyDown handler on your input. Something like this:
For date validation you would also include the / character. Then I would attach an event handler to the onBlur event on your inputs. Use that even handler to run the input against a regex to make sure a proper date was entered.