diff --git a/src/app/content/hemat-app/master/master-building/add-edit-master-building/add-edit-master-building.component.ts b/src/app/content/hemat-app/master/master-building/add-edit-master-building/add-edit-master-building.component.ts index f34c0e2..efc156f 100644 --- a/src/app/content/hemat-app/master/master-building/add-edit-master-building/add-edit-master-building.component.ts +++ b/src/app/content/hemat-app/master/master-building/add-edit-master-building/add-edit-master-building.component.ts @@ -57,9 +57,9 @@ export class AddEditMasterBuildingComponent { id: this.dataRow.id, name: [this.dataRow.name, Validators.required], statusId: [this.dataRow.status_id, Validators.required], - email: [this.dataRow.email, [Validators.required, Validators.email]], + email: [this.dataRow.email, [Validators.required, Validators.pattern(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/)]], owner: [this.dataRow.owner, Validators.required], - address: [this.dataRow.address, Validators.required], + address: [this.dataRow.address, [Validators.required, Validators.pattern(/^[0-9]{10,15}$/)]], phone: [ this.dataRow.phone, [Validators.required, Validators.pattern("^[0-9]*$")], diff --git a/src/app/content/hemat-app/user-profile/profil-information/profil-information.component.html b/src/app/content/hemat-app/user-profile/profil-information/profil-information.component.html index 16c9a0c..7d645af 100644 --- a/src/app/content/hemat-app/user-profile/profil-information/profil-information.component.html +++ b/src/app/content/hemat-app/user-profile/profil-information/profil-information.component.html @@ -17,19 +17,11 @@ formControlName="firstName" maxlength="20" placeholder="John Vander" - [ngClass]="{ - 'is-invalid': submitted && f.firstName.errors - }" + [ngClass]="{'is-invalid': profilInfo.get('firstName').invalid && profilInfo.get('firstName').touched}" /> - -
- Full First Name is required -
-
+
+ First name is required. +
@@ -40,19 +32,11 @@ formControlName="lastName" maxlength="20" placeholder="John Vander" - [ngClass]="{ - 'is-invalid': submitted && f.lastName.errors - }" + [ngClass]="{'is-invalid': profilInfo.get('lastName').invalid && profilInfo.get('lastName').touched}" /> - -
- Full lastName is required -
-
+
+ Last name is required. +
@@ -63,17 +47,11 @@ formControlName="email" placeholder="email@email.com" maxlength="50" - [ngClass]="{ - 'is-invalid': submitted && f.email.errors - }" + [ngClass]="{'is-invalid': profilInfo.get('email').invalid && profilInfo.get('email').touched}" /> - -
Email is required
-
+
+ Please enter a valid email. +
@@ -85,17 +63,11 @@ maxlength="13" placeholder="08**************" pattern="^[0-9]*$" - [ngClass]="{ - 'is-invalid': submitted && f.phone.errors - }" + [ngClass]="{'is-invalid': profilInfo.get('phone').invalid && profilInfo.get('phone').touched}" /> - -
Phone is required
-
+
+ Please enter a valid phone number. +