Search code examples
jquerydatemaskedtextbox

JavaScript date mask to MySQL date


I want to mask a date input to mm/dd/yyyy. When the form submits, i want to convert that to YYYY-MM-DD for mysql.

Would it be best to change the value of the input field, or have hidden inputs that store the conversion and use the value of the hidden field?

Is there a known jquery plugin for this? Is that known as a reverse mask?


Solution

  • Seems to me that it would be best to take the input from the form and parse it to the correct date type in the form code, not the frontend.