-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple useForm in same page with different component not working #3270
Comments
You cannot use multiple However, you can use multiple If you are trying to have some sort of nested forms, this is not really something vee-validate will do in the near future, so you are better off having 1 large form or multiple independent forms Here is a couple of examples: This will work fine if you keep exactly one
This won't work:
I think this is a duplicate of #3204 so closing this in favor of tracking the issue there, LMK if it's not the same issue, and if it is then please create an example so I can differentiate the two. |
Hi @logaretm I am trying to do exactly the same thing which defined in the attached code. now when I am submit the this is the problem while submitting the forms |
You can't have 2 form elements within each other so you will need to change your HTML. Also, |
@logaretm As you suggest that we need to set up each useForm() in a single component. so I changed my html
and still not working. the validation of the component-1 form is not validating and does not generate an error and the form is submitted without validating |
Can you create an example on codesandbox? |
@logaretm As you asked to example, here I am dropping a link of code sandbox, please doesn't consider the design, just see the functionality and give your comment. https://codesandbox.io/s/frosty-darkness-8889m?file=/src/App.vue |
Thank you for the example, this was caused by vee-validate prioritizing parent-injected symbols instead of self-injected ones. I have changed this to use the self-injection if exists, which is your case here. But you need to make sure to call Will tag this tweak in the next patch release. |
Hi @logaretm Thanks for consider this issue and quick fix. |
Versions
Describe the bug
When trying to validate multiple form with same page but defferent component with the composition api and useForm() and useField(), the validation is not working on one component.
So I am trying to make a form in one component and one form in another component which is modal (form in the modal), and then both component are called on one page. In this the form in modal is not validating.
To reproduce
Steps to reproduce the behavior:
The text was updated successfully, but these errors were encountered: