-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Form validation with custom patterns fails if javascript is disabled #11671
Comments
Hi @rubenquidam, thanks for bringing this to our attention again. I have created a PR. Can you review it? |
|
We do not support Foundation 5 anymore. So this will just land in 6 and newer releases. |
@rubenquidam the docs recommend (more or less obvious) to use But you're right, we shouldn't encourage to use non-standard values for standard attributes. |
@DanielRuf I took a look at your PR: |
@DanielRuf I don't have experience with foundation myself to review the PR, I'm just reporting it from the POV of a browser maintainer. @SassNinja I agree that this is mostly a documentation and advice issue, just make sure that pattern is only used for standard values (regex) so the nonstandard values there can be deprecated. Thanks to both for working on this. |
This happens with sites that use custom values for the pattern attribute, such as "alpha_numeric" which are not part of the html5 spec (which requires a regexp).
What should happen?
Form should still be usable even if javascript is disabled or foundation.js is blocked.
What happens instead?
Fields not matching the regular expression prevent the form from being submitted. In the case of the previous form, first field, it would pass it if you write "alpha_numeric" as the field content.
Possible Solution
Please do not advise people to use the pattern field in ways that don't comply with the html5 standard! You seem to already have some other way to do it with custom attributes, so please don't use the standard one for this, as it breaks functionality for people opting out of your library.
Test Case and/or Steps to Reproduce (for bugs)
Test Case: https://amazonwatch.org/take-action/urge-ecuadors-new-oil-friendly-environmental-minister-to-reject-yasuni-oil-drilling
That is not my site, I'm a web browser developer.
How to reproduce:
Context
I maintain web browsers and extensions that focus on privacy and software freedom, and I was reported that sites using your library may fail to validate forms if javascript is disabled.
Your Environment
Checklist
There is one, but you closed it! Abide Pattern HTML5 issue #6501
Please don't close this ticket until it is corrected, you are encouraging web developers to break standards.
The text was updated successfully, but these errors were encountered: