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

Adds support for the formnovalidate attribute to skip validation on back buttons in multi-page forms. #15

Merged

Conversation

AndyButland
Copy link
Contributor

@AndyButland AndyButland commented Mar 15, 2022

When you have a multi-page form, and a user is on page 2 that has some required fields, we don't want them to proceed without completing valid input, but we should allow them to go back to page 1.

There's an HTML 5 attribute for this, formnovalidate, that can be added to submit buttons indicating that they shouldn't trigger validation. Adding support for this was a request in the original repository for this library (see here).

I've added a check in this PR to see if that attribute exists in the element that triggered the form submission, and if found, to not validate.

Also made small changes to the readme and build command, that looked to be necessary to build the project.

Copy link
Owner

@haacked haacked left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR!

README.MD Outdated Show resolved Hide resolved
@haacked haacked merged commit 0d19f88 into haacked:main Mar 15, 2022
@haacked
Copy link
Owner

haacked commented Mar 15, 2022

I'm trying to publish this to NPM but having some weird auth problems.

@AndyButland
Copy link
Contributor Author

Thanks for picking up so quickly. Looks to me that the update has made it to npm.

@haacked
Copy link
Owner

haacked commented Mar 15, 2022

Yup! I figured it out

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

Successfully merging this pull request may close these issues.

2 participants