customers form issue fix

This commit is contained in:
Surendiran 2023-07-11 11:56:25 +05:30
parent 5ec3ee5299
commit 58565684ed

View File

@ -7,12 +7,14 @@
<div mat-dialog-content class="my-table">
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>Name</mat-label>
<input placeholder=" Name" matInput formControlName="cusName">
<mat-error *ngIf="myError('cusName', 'required')">Name is required</mat-error>
<mat-error *ngIf="myError('cusName', 'maxlength')">Limit exceed</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>Email</mat-label>
<input type="email" placeholder=" Email" matInput [(ngModel)]="local_data.email" formControlName="email">
<mat-error *ngIf="!form.get('email')?.errors?.required && (form.get('email')?.errors?.pattern)">
Please enter a valid email address
@ -23,29 +25,34 @@
</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<input placeholder=" Mobile No" type="text" appMobileNumberPattern maxlength="10" minlength="10" matInput [(ngModel)]="local_data.phoneNo" formControlName="phoneNo">
<mat-label>Mobile No</mat-label>
<input placeholder="Mobile No" type="text" appMobileNumberPattern maxlength="10" minlength="10" matInput [(ngModel)]="local_data.phoneNo" formControlName="phoneNo">
<mat-error *ngIf="myError('phoneNo', 'required')">Contact No is required</mat-error>
<mat-error *ngIf="myError('phoneNo', 'pattern')">Invalid Contact No </mat-error>
<mat-error *ngIf="myError('phoneNo', 'minlength')"> Contact No must be at least 10 characters</mat-error>
<mat-error *ngIf="myError('phoneNo', 'maxlength')">Limit exceed</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<input placeholder=" Address" matInput [(ngModel)]="local_data.address_1" formControlName="address_1">
<mat-label>Address</mat-label>
<input placeholder="Address" matInput [(ngModel)]="local_data.address_1" formControlName="address_1">
<mat-error *ngIf="myError('address_1', 'required')">Address is required</mat-error>
<mat-error *ngIf="myError('address_1', 'maxlength')">Limit exceed</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<input placeholder=" State" matInput [(ngModel)]="local_data.state" formControlName="state">
<mat-label>State</mat-label>
<input placeholder="State" matInput [(ngModel)]="local_data.state" formControlName="state">
<mat-error *ngIf="myError('state', 'required')">State is required</mat-error>
<mat-error *ngIf="myError('state', 'maxlength')">Limit exceed</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<input placeholder=" City" matInput [(ngModel)]="local_data.city" formControlName="city">
<mat-label>City</mat-label>
<input placeholder="City" matInput [(ngModel)]="local_data.city" formControlName="city">
<mat-error *ngIf="myError('city', 'required')">City is required</mat-error>
<mat-error *ngIf="myError('city', 'maxlength')">Limit exceed</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<input placeholder=" Pincode" matInput [(ngModel)]="local_data.pincode" formControlName="pincode">
<mat-label>Pincode</mat-label>
<input placeholder="Pincode" matInput [(ngModel)]="local_data.pincode" formControlName="pincode">
<mat-error *ngIf="myError('pincode', 'required')">Pincode is required</mat-error>
<mat-error *ngIf="myError('pincode', 'maxlength')">Limit exceed</mat-error>
</mat-form-field>