feat: add phone number validation to employee create form (#2920)
This commit is contained in:
@@ -61,6 +61,15 @@
|
|||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<mat-label>{{ 'labels.inputs.Mobile Number for SMS' | translate }}</mat-label>
|
<mat-label>{{ 'labels.inputs.Mobile Number for SMS' | translate }}</mat-label>
|
||||||
<input matInput formControlName="mobileNo" />
|
<input matInput formControlName="mobileNo" />
|
||||||
|
@if (
|
||||||
|
employeeForm.controls.mobileNo.hasError('pattern') &&
|
||||||
|
(employeeForm.controls.mobileNo.dirty || employeeForm.controls.mobileNo.touched)
|
||||||
|
) {
|
||||||
|
<mat-error>
|
||||||
|
{{ 'labels.inputs.Mobile Number for SMS' | translate }} {{ 'labels.commons.is' | translate }}
|
||||||
|
<strong>{{ 'labels.commons.invalid' | translate }}</strong>
|
||||||
|
</mat-error>
|
||||||
|
}
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field (click)="joiningDatePicker.open()">
|
<mat-form-field (click)="joiningDatePicker.open()">
|
||||||
|
|||||||
@@ -103,7 +103,12 @@ export class CreateEmployeeComponent implements OnInit, AfterViewInit {
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
isLoanOfficer: [false],
|
isLoanOfficer: [false],
|
||||||
mobileNo: [''],
|
mobileNo: [
|
||||||
|
'',
|
||||||
|
[
|
||||||
|
Validators.pattern(/^\+?[0-9. ()-]{0,25}$/)
|
||||||
|
]
|
||||||
|
],
|
||||||
joiningDate: [
|
joiningDate: [
|
||||||
'',
|
'',
|
||||||
Validators.required
|
Validators.required
|
||||||
|
|||||||
Reference in New Issue
Block a user