You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
input type=date works fine on all modern browsers that support that type. The problems arise in non supporting browsers:
Internet Explorer and Safari
The date picker on modern browsers allows the user to pick a date visually and then submits it using the ISO standard of yyyy-mm-dd.
However, on the fallback for IE/Safari there is no visual picker and its just a type=text field, which will fail validation unless the users submit yyyy-mm-dd which is relatively uncommon thing to ask for.
if we look in system/src/Grav/Common/Data/Validation.php Line 490
This now passes validation for IE/Safari but will fail in modern browsers where the visual picker still submits yyyy-mm-dd
Potential fix
add an option for validate: such as date: false that will make sure the field is required but not validated against a date, letting us submit 2 different type of inputs
The text was updated successfully, but these errors were encountered:
input type=date
works fine on all modern browsers that support that type. The problems arise in non supporting browsers:Internet Explorer and Safari
The date picker on modern browsers allows the user to pick a date visually and then submits it using the ISO standard of
yyyy-mm-dd
.However, on the fallback for IE/Safari there is no visual picker and its just a
type=text
field, which will fail validation unless the users submityyyy-mm-dd
which is relatively uncommon thing to ask for.if we look in
system/src/Grav/Common/Data/Validation.php
Line 490we can see there is an optional format. So by modifying our form such as:
This now passes validation for IE/Safari but will fail in modern browsers where the visual picker still submits
yyyy-mm-dd
Potential fix
validate:
such asdate: false
that will make sure the field is required but not validated against a date, letting us submit 2 different type of inputsThe text was updated successfully, but these errors were encountered: