Validation fails when putting step="1" in a "datetime-local" input type

Author: rigobauerCreated Jul 4, 2017Updated May 24, 2024
LabelsType: BugStatus: Verified

Subject of the issue

When I put step="1" in a datetime-local input field to show seconds, if I'm validating that field with the plugin (just "required", for example), I get a javascript error saying "Step attribute on input type datetime-local is not supported". If I put this step="1" in a field that is not being validated, it works without problems.

Your environment

  • jquery-validate 1.16.0
  • Chrome (Versión 59.0.3071.115 (Build oficial) (64 bits))

Steps to reproduce

Just create a datetime-local input field with step="1", and try to validate it with required.

Expected behaviour

When you put step="1" in a datetime-local field, the field shows seconds (by default you can just see minutes because default value is step="60")

Actual behaviour

If the step="1" is in a field that is being validated with the plugin, you get a Javascript error with message "Step attribute on input type datetime-local is not supported".

Source: jquery-validation/jquery-validation