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

Previous button triggers validation (when not using jQuery) #741

Closed
skttl opened this issue Mar 10, 2022 · 2 comments
Closed

Previous button triggers validation (when not using jQuery) #741

skttl opened this issue Mar 10, 2022 · 2 comments

Comments

@skttl
Copy link

skttl commented Mar 10, 2022

In a multipage setup, using aspnet-validation.js instead of jquery validation, the Previous button triggers validation, thus preventing the user in navigating to the previous page without meeting the validation criteria.

I would expect it to not try to validate, and simply go to the previous page. That is what it does, when using jquery-validate.

This has been seen in Forms 9.3.0 and 8.9.1.

To reproduce:
Create a form with multiple pages, make sure there are mandatory fields on all pages.
Render the form with aspnet-validation.js (not sure if @Html.RenderUmbracoFormDependencies() does that by default)
Fill in the fields to go to page 2.
Don't fill in fields on page 2 and try to click Previous.
The form will try to validate itself, and prevent going to previous page if validation fails.

@AndyButland
Copy link

I've created a PR to add support for this in the aspnet-validation.js library. If accepted, we can update forms to reference this version and add support for this via adding formnovalidate attribute to the previous page submit button.

@AndyButland
Copy link

The PR was accepted and so we've taken a dependency on this updated version of the library, which allows us to then include formnovalidate on the previous submit button in the default theme (or for anyone to add it to their custom themes).

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

2 participants