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

Multi step wizard #95

Open
msirse opened this issue Sep 9, 2024 · 1 comment
Open

Multi step wizard #95

msirse opened this issue Sep 9, 2024 · 1 comment
Assignees

Comments

@msirse
Copy link

msirse commented Sep 9, 2024

Laravel Precognition Plugin Version

0.5.8

Laravel Version

11

Plugin

Vue w/ Inertia

Description

Multi step wizard and user validate first step and jump to second step. Then click back and jump back to first step.

If the user has not touched any fields, you cannot validate the same fileds. How can I now than form is alrady validated and skip validation, and jump to second step.

Steps To Reproduce

Step 1

skip validation if the user has not touched any fields and the form has already been validated or validate again....

form.touch(["first_name", "last_name"]).validate({
onSuccess: (response) => {
nextStep()
},
});

@timacdonald
Copy link
Member

We would need to add a setTouched function to allow you to control what fields are currently touched. The touch function is always additive.

form.touch(['name'])

form.touch(['email'])

// name and email are now "touched"

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

3 participants