Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Form validation within child components. #360

Open
mreduar opened this issue Feb 17, 2021 · 1 comment
Open

Form validation within child components. #360

mreduar opened this issue Feb 17, 2021 · 1 comment

Comments

@mreduar
Copy link

mreduar commented Feb 17, 2021

Hi, I am here because I am having problems validating the forms inside the components of each step. Give an example to better understand what I want to achieve.
I have the following code.

<form-wizard>
    <tab-content>
        <step1></step1>
    </tab-content>
    <tab-content title="Público">
        <step2></step2>
    </tab-content>
    ...
</form-wizard>

I have several components, each containing everything from a single step.
For example in the step1 and step2 components, I have a form which I want to validate before passing to the next step.
How can I achieve this?
Due to the nature of the problem, I also don't know how to extract the form to the parent element. Which in this case is the component containing component.

@mreduar
Copy link
Author

mreduar commented Feb 17, 2021

In one example I realized that I can achieve this with before-change in conjunction with ref like this.
https://jsfiddle.net/CristiJ/bt5dhqtf/286/
Thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant