vue-form-wizard
vue-form-wizard copied to clipboard
Validation not being triggered on back
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.
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 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 @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 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).
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.
I still have this error. It validates on button back.. but not in previous step circle. Any workarounds ?
same. still it doesn't validate on back
@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"

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

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!