I am searching for a simple way to have onSubmit validating. The only way i was able to do that was by creating isSubmitted flag and then make multiple tenery statements for each input field :)
Are there any way to disable the validation until some point when the form is submitted :) ?
You can add a data-vv-validate-on and assign it any non-html event name, the validation won't occur. so you would trigger them using validateAll.
<input v-validate="'required'|email'" name="email" data-vv-validate-on="none">
<form @submit.prevent="$validator.validateAll()"></form>
I might add a disable modifier for this purpose in next releases.
I'd love to be able to disable validation on _all_ fields!
As a follow up, data-vv-validate-on="none" doesn't work on inputs with a confirmed rule
@hatzipanis One option would be to add a long delay to the validation. This would keep the errors from showing until you trigger valdiateAll(), which will overwrite the delay.
However I would assume this will add timers for all your validated fields which might be a performance issue.
An option to disable real time validation would be a valuable addition in my eyes so we don't have to litter 'data-vv-validate-on="none"' all over our forms.
Has this even been fixed in a way we can validate on submit without adding data-vv-validate-on="none" everywhere?
@burzum have a look if this solves your issue:
https://github.com/baianat/Vee-validate/issues/469
A combination of .disable and $validator.validateAll() does the job for us.
It was already mentioned above but maybe the example in the linked issue is helpful.
Most helpful comment
You can add a
data-vv-validate-onand assign it any non-html event name, the validation won't occur. so you would trigger them usingvalidateAll.I might add a
disablemodifier for this purpose in next releases.