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

Option to allow navigating from a step without completing all required fields #1301

Open
4 tasks done
purplespider opened this issue Jun 6, 2024 · 1 comment
Open
4 tasks done

Comments

@purplespider
Copy link
Contributor

Description

Currently, on a multistep form with required fields, a user cannot progress to the next step unless they have completed all the required fields on the current step.

This can be frustrating for users, as they cannot click through all the steps to first check what data is required before starting to complete the form.

It would be nice to have an option that disables field validation for the current step when switching to a different step.

Looking through the code, this should be relatively easy to implement, as it already allows you to jump to a "viewed" step, if the current step is invalid. It looks like the following changes would be required:

  1. If this option is enabled, skip the check on line 643
  2. After jumping to a step from a link in error-container, trigger validation. (If a user attempts to submit a form with validation issues, it already presents a list of links to steps with issues, but when clicking one of these steps, it should ideally highlight the invalid fields by initiating validation.)

If the above sounds ok, I'd be happy to give this a bash, but will need some basic pointers on getting the tooling up and running. Thanks!

Additional context or points of discussion

No response

Validations

  • You intend to implement the feature yourself
  • You have read the contributing guide
  • You strongly believe this feature should be in core, rather than being its own community module
  • You have checked for existing issues or pull requests related to this feature (and didn't find any)
@GuySartorelli
Copy link
Member

Sounds sensible. It should probably be an opt-in and target the next minor release (i.e. the 6 branch).

There's docs about setting up and using build tooling in https://docs.silverstripe.org/en/5/contributing/build_tooling/, and most everything else you should need to know is in https://docs.silverstripe.org/en/5/contributing/code/ - but let me know if you get stuck and I'll see how I can help.

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