-
Hey, this is not an issue but more like a question, sorry about that... Is there a way to server-validate individual form inputs in VeeValidate v3? I mean I get how to server-validate on submit from your example in docs, that is working splendidly, but I would like to send individual values to the server on change/blur and such, quick check them against server validation rules and send back JSON object for setErrors(). My idea was to write something along the lines of (pseudocode):
This is working, but similarly to submit validation. Problem is, there is no way to find out which field is being validated in this custom provider, so I'm forced to send the whole model and not just this one input value to be validated and I receive all errors, even for inputs not yet edited by user. Ideally I would like to send only value of current input to server (which is possible) but I need to tell server which value I'm sending. Or I can keep sending whole model and pick just the error specific for the current field from the server response. Either way, I need to know the name of the ValidationProvider. At first I thought, that I'll use the Maybe I'm missing something... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I've moved this as a discussion since this is a question. vee-validate v3 doesn't really offer you a way to find out which field is getting validated by which function, in v4 it is possible since the validation function receives a third argument being the context of the validation. I can't think of workarounds for this at the moment. |
Beta Was this translation helpful? Give feedback.
I've moved this as a discussion since this is a question.
vee-validate v3 doesn't really offer you a way to find out which field is getting validated by which function, in v4 it is possible since the validation function receives a third argument being the context of the validation.
I can't think of workarounds for this at the moment.