0

Is there a way to change the default message "Invalid date" by the french equivalent "Date invalide" for an input type="date" in HTML or JS/JQuery.

Thanks !

  • Did you tried creating custom validation message using http://stackoverflow.com/questions/5272433/html5-form-required-attribute-set-custom-validation-message/5276722#5276722 ? – Adib Aroui May 28 '15 at 13:43

3 Answers3

1

You could use this

<input type="date" oninvalid="setCustomValidity('Date invalide')" />

It's pretty well supported

George
  • 6,630
  • 2
  • 29
  • 36
0

to change the default validation message refer this code <input type="date" oninvalid="setCustomValidity('Date Invalid ')" onchange="try{setCustomValidity('')}catch(e){}" />

hope this is what you are asking for there is a bug with george's ans which is seen when you give wroung input once and re edit to enter the correct one and submit the form

Mayur
  • 68
  • 7
0

I recommend you to use this civem.js script Custom Input Validation Error Messages script

aproskam
  • 121
  • 1
  • 1
  • 10