Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rigobauer opened this issue Jul 4, 2017 · 5 comments
Open

Comments

@rigobauer
Copy link

rigobauer commented Jul 4, 2017

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".

@brunoalreis
Copy link

Hi,

Have same issue here. Is there any known workaround?

Thanks.

@staabm
Copy link
Member

staabm commented Aug 28, 2017

please provide a jsfiddle showing the problem, thx.

@brunoalreis
Copy link

brunoalreis commented Aug 28, 2017

Here is the example:

https://jsfiddle.net/na6Lqpar/

To reproduce the problem, click in the first input then in the second and check console errors.

Thanks.

@staabm
Copy link
Member

staabm commented Aug 28, 2017

awesome, thx

@jameswilson
Copy link

I've setup a very complete jsbin to compare native html5 validation with each date type that demonstrates several issues related to min/max calculations and breakage due to the "step" attribute.

https://jsfiddle.net/w8jpygr2/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants