I want to validate a group of inputs on my form. I don't need individual names, so I tried to use form.name.$valid to check all.
I pushed a number to a array to increment the number of inputs. The problem is when I remove an input the validity of the inputs become wrong.
Here is a fiddle showing this issue.
To reproduce the problem, fill the first input. Inputs valid, form valid. Add an input and fill it too. Both valid again. Remove the last input, inputs invalid, form valid.
How can I validate using this type of dynamic form? I will need to use ng-form with individual messages even I want just one error message for all inputs?
Aucun commentaire:
Enregistrer un commentaire