rocklobster-in / contact-form-7

Contact Form 7 - Just another contact form plugin for WordPress.
Other
287 stars 140 forks source link

Fallback for date picker on Safari/IE #333

Closed kashtodi closed 3 years ago

kashtodi commented 3 years ago

Some browsers (e.g. Safari for Mac, Internet Explorer) do not support HTML5 date and time input types (yet). Because of this, the date picker UI does not appear in any "Date" form fields and no placeholder hint is provided about the expected date format, which can be confusing for users.

As a solution, the following workaround should be implemented (suggested here: https://stackoverflow.com/a/56577624):

add a placeholder attribute to the date input. This informs Safari and IE users which format the fallback text input should be (which is yyyy-mm-dd). The placeholder doesn't display on browsers that support type="date" so this workaround won't affect other browsers. e.g. <input type="date" placeholder="yyyy-mm-dd" />

takayukister commented 3 years ago

See https://contactform7.com/date-field/