Answer the question
In order to leave comments, you need to log in
How to validate a form that has branching logic with hidden fields?
How to be in a situation when the form in itself contains logic and hidden fields that are displayed depending on the selected previous value. Those. The problem is that hidden fields are also validated, although they should not affect the validation result themselves, since according to the logic of filling out the form, they did not have to be displayed.
Example
Radio button select Pizza or Soup: Selected
1st - Pizza -> show three select fields:
ingredient 1(ng-required)
ingredient 2(ng-required)
ingredient 3(ng-required)
Selected 2nd - Soup -> , 1 field-selector
name of the soup (ng-required) was added.
In fact, all fields that are ng-required will get into the form validation, although if we did not select Pizza, three fields must already be omitted from the validation.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question