Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Validation not being triggered on back #252

Open
davidnoguerol opened this issue Jul 5, 2018 · 8 comments
Open

Validation not being triggered on back #252

davidnoguerol opened this issue Jul 5, 2018 · 8 comments

Comments

@davidnoguerol
Copy link

davidnoguerol commented Jul 5, 2018

This is a continuation of #12

When you click on a circle of a previous step (instead of the back button) and :validateOnBack="true", it doesn't try to validate on the current step. But if you click on the back button, then it triggers the validation.

Shouldn't it validate in both cases? @cristijora is this something you could advise on?

Thanks in advance.

@davidnoguerol davidnoguerol changed the title Validation not being triggered on back even with validateOnBack set to true Validation not being triggered on back Jul 5, 2018
@minasm
Copy link

minasm commented Jul 21, 2018

In my case the back button is not validating as well.

<tab-content :after-change="validateOnBack">
Are you using something like this as well?

Thanks

@davidnoguerol
Copy link
Author

@minasm I'm not using :after-change

Once I use <form-wizard :validate-on-prev="true" ... I expect <tab-content :before-change="myValidationMethod"... to be triggered when I click on a previous step.

@cristijora
Copy link
Collaborator

@davidnoguerol @minasm
By default back validation is disabled but there is a prop to switch it on if you need it.
https://binarcode.github.io/vue-form-wizard/#/?id=form-wizard-props
validateOnBack https://codesandbox.io/s/l9mz5zn7yz

Just add the prop on the wizard <form-wizard validate-on-back> and it should work

@davidnoguerol
Copy link
Author

@cristijora
I've tried this (just now), it does work when I click on the back button, but it doesn't work when I click on a previous step circle (only forward).

@minasm
Copy link

minasm commented Jul 27, 2018

hmm apparently I have a different error somewhere. I wish there was an option to have different validations as you may not want to run the same method on the back and previous buttons.

@pimboden
Copy link

pimboden commented Apr 6, 2021

I still have this error. It validates on button back.. but not in previous step circle.
Any workarounds ?

@karlpatrickespiritu
Copy link

same. still it doesn't validate on back

@EdsonJunior29
Copy link

EdsonJunior29 commented May 4, 2023

@cristijora
I accessed the URL https://codesandbox.io/s/l9mz5zn7yz
When I click on the back button the application goes back to the previous step normally.
This occurs even by adding the following code:
validate-on-back="false" or
:validate-on-back="false"

image
image

I tried to create a method. But when clicking on the back button the application does not block.
image
image

Could you help me to solve this problem?
Because I'm using the form-wizard in an application and I need to block the back button.

Thank you very much in advance!

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

No branches or pull requests

6 participants