invalidate an input field based on response from API? #4049
Unanswered
mdigital123
asked this question in
Q&A
Replies: 1 comment 3 replies
-
If you want to keep using the component API then you can use This is not mentioned in the docs, so I will try to add it over the weekend. <template>
<Form ref="formRef">
<!-- ... -->
</Form>
</template>
<script setup>
const formRef= ref();
// in a function or whatever
formRef.value.validate();
</script> |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an email input where if you input an email, it validates as valid, but I want to invalidate the input based on a certain type of response I receive and attach a custom error message to it. I am using
"vee-validate": "^4.6.6",
.The schema below obviously doesn't work, but I was thinking if I can manually trigger the form to revalidate itself again, then the email should error out but I am not sure how to manually trigger a validation on my form again.
Thanks.
schema
form
email component
Beta Was this translation helpful? Give feedback.
All reactions