Click here to Skip to main content
15,888,325 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a nested form inside *ngFor in Angular. How can I get validation status of all forms?

Below is my code

HTML
<pre><div *ngFor="let row of Items">
  <form #budgetForm="ngForm">

    <input required matInput name="Amount" [(ngModel)]="row.Amount">

  </form>
  {{budgetForm.valid}}
</div>


What I have tried:

I enclosed the nested form inside main form and it did not work
Posted
Comments
Richard Deeming 27-Nov-18 12:27pm    
You can't have one form nested inside another - HTML doesn't allow it.

How do you currently get the validation status for a single form?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900