Answers for "angular submit with required"

0

angular submit with required

<form (ngSubmit)="onSubmit()" #testForm="ngForm" ngNativeValidate>
  <input type="text" id="test1" name="test1" [(ngModel)]="test" required>
  <input type="text" id="test2" name="test2" [(ngModel)]="test" [required]="true">
  <input type="text" id="test3" name="test3" [(ngModel)]="test" [attr.required]="true">
  <button type="submit">submit</button>
</form>


<-- The important thing here is the "ngNativeValidate" -->
Posted by: Guest on March-08-2021

Code answers related to "angular submit with required"

Code answers related to "Javascript"

Browse Popular Code Answers by Language