提交表单后,我的表单字段变为必填字段?

时间:2018-08-10 10:31:37

标签: javascript angular angular-forms

成功提交表单后,表单字段再次变为必填字段。请注意,页面不会在提交时刷新,但会重置表单。       Error Image

<form #contactUsForm>                        
    <mat-form-field>
     <input type="text" matInput 
      (blur)="nameValidate()" [(ngModel)]="_userName" name="uName" required>
    </mat-form-field>    

   <mat-form-field>
    <input type="email" matInput [(ngModel)]="_userEmail" name="uEmail" 
      (blur)="emailValidate()" required>
   </mat-form-field>                      

   <div>
    <button type="submit" (click)="onSubmit();contactUsForm.reset()"  
       mat-raised-button>Submit </button>
   </div>
</form>

事件触发有什么问题吗?

0 个答案:

没有答案