jzaefferer/jquery-validation — Issue #304: input[type=date] fails validation regardless of what rules exist
Author: kapowaz
Created: 2012-01-16 16:36:08+00:00
State: open

If you include an input with a type of date in your form, and validate the rest of the form, then values which are valid for that type of input (the spec for which mandates an ISO date format of YYYY-MM-DD) will be flagged as invalid. Infuriatingly, it appears impossible to bypass this, since jquery-validation always tries to validate this type of input regardless of what rules you've specified. Attempting to forcibly remove the rule for that element (with $('input[type=date]').rules('remove'), say) initially appears to have succeeded, but querying the rules shows that it remains in effect.

The upshot of this is that browsers that now support input[type=date] have to be given a downgraded experience (either a series of selects, or an input[type=text]) rather than the new native control (i.e. Mobile Safari/iOS 5.0), *or* sacrifice jQuery validation.