Skip to content

Revalidate when children changes #1139

Answered by radekmie
simplecommerce asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @simplecommerce. Technically, it shouldn't matter if a field is visible or not - the user completed it by successfully validating the data. In other words, the visibility of a field should not affect its validation.

What we do in our Form Builder is a schema that is aware of visibility, i.e., both the validation and rendering use the same logic. This makes this problem non-existent as if a field should not be visible, it is not validated and it gets validated if it is. The last part is that the conditions may include only one source of variables - the state of the form (i.e., values of other inputs).

What are the conditions you show/hide your fields on? If they rely only on the model, …

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@radekmie
Comment options

@simplecommerce
Comment options

@radekmie
Comment options

@simplecommerce
Comment options

@radekmie
Comment options

Answer selected by radekmie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants