2

I have a problem with chrome: when I insert an incomplete date in an input date, like "12/dd/yyyy" and I submit the form, chrome shows me an error like

Please enter a valid value. The field is incomplete or has an invalid date

error

Anyone knows how to remove this error and show a custom error with jquery or js, like: "ERROR: The date you entered is not valid"?

Sorry for my english and thanks in advice.

1 Answers1

2

You should use novalidate. It prevents the automatic browser validation when submitting a form.

This form will not submit if the input is invalid:

<form action="#">
  <input type="date"/>
  <input type="submit"/>
<form>

This form will submit even if the input is invalid:

<form action="#" novalidate>
  <input type="date"/>
  <input type="submit"/>
<form>
Wais Kamal
  • 5,858
  • 2
  • 17
  • 36