HTML5 date picker doesn't show on Safari

前端 未结 6 1873
星月不相逢
星月不相逢 2021-02-02 05:13

Having previously used jQuery date picker, I have now converted some of the date fields in forms on my website to the HTML5 date picker.

On the documentation, it says Sa

6条回答
  •  难免孤独
    2021-02-02 05:52

    You can use a regex pattern to validate the format in the placeholder like in the example above. The one here is a good starting point but you may want to create your own.

    Try the code below in Safari without adding a valid formatted value like a string of text.

    Incorrect format shows a validation error, correct format (dd/mm/yyyy or dd-mm-yyyy) will submit the form, and it disappears.

提交回复
热议问题