edit profile
This commit is contained in:
parent
a455f43df6
commit
876f039603
|
@ -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]*$")],
|
||||
|
|
|
@ -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}"
|
||||
/>
|
||||
<small
|
||||
class="form-text text-muted danger"
|
||||
*ngIf="submitted && f.firstName.errors"
|
||||
class="invalid-feedback"
|
||||
>
|
||||
<div *ngIf="f.firstName.errors.required">
|
||||
Full First Name is required
|
||||
<div *ngIf="profilInfo.get('firstName').invalid && profilInfo.get('firstName').touched" class="text-danger">
|
||||
First name is required.
|
||||
</div>
|
||||
</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="lastName" style="color: #ffffff">Last Name</label>
|
||||
|
@ -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}"
|
||||
/>
|
||||
<small
|
||||
class="form-text text-muted danger"
|
||||
*ngIf="submitted && f.lastName.errors"
|
||||
class="invalid-feedback"
|
||||
>
|
||||
<div *ngIf="f.lastName.errors.required">
|
||||
Full lastName is required
|
||||
<div *ngIf="profilInfo.get('firstName').invalid && profilInfo.get('firstName').touched" class="text-danger">
|
||||
Last name is required.
|
||||
</div>
|
||||
</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email" style="color: #ffffff">Email</label>
|
||||
|
@ -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}"
|
||||
/>
|
||||
<small
|
||||
class="form-text text-muted danger"
|
||||
*ngIf="submitted && f.email.errors"
|
||||
class="invalid-feedback"
|
||||
>
|
||||
<div *ngIf="f.email.errors.required">Email is required</div>
|
||||
</small>
|
||||
<div *ngIf="profilInfo.get('email').invalid && profilInfo.get('email').touched" class="text-danger">
|
||||
Please enter a valid email.
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="phone" style="color: #ffffff">Phone</label>
|
||||
|
@ -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}"
|
||||
/>
|
||||
<small
|
||||
class="form-text text-muted danger"
|
||||
*ngIf="submitted && f.phone.errors"
|
||||
class="invalid-feedback"
|
||||
>
|
||||
<div *ngIf="f.phone.errors.required">Phone is required</div>
|
||||
</small>
|
||||
<div *ngIf="profilInfo.get('phone').invalid && profilInfo.get('phone').touched" class="text-danger">
|
||||
Please enter a valid phone number.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 d-flex justify-content-center align-items-center">
|
||||
|
|
Loading…
Reference in New Issue