vue-form-wizard icon indicating copy to clipboard operation
vue-form-wizard copied to clipboard

Validation not being triggered on back

Open davidnoguerol opened this issue 7 years ago • 8 comments

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 avatar Jul 05 '18 18:07 davidnoguerol

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

minasm avatar Jul 21 '18 20:07 minasm

@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.

davidnoguerol avatar Jul 23 '18 08:07 davidnoguerol

@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

cristijora avatar Jul 23 '18 08:07 cristijora

@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).

davidnoguerol avatar Jul 23 '18 08:07 davidnoguerol

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.

minasm avatar Jul 27 '18 17:07 minasm

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

pimboden avatar Apr 06 '21 11:04 pimboden

same. still it doesn't validate on back

karlpatrickespiritu avatar Mar 10 '22 11:03 karlpatrickespiritu

@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!

EdsonJunior29 avatar May 04 '23 17:05 EdsonJunior29