perbaikan kwh

This commit is contained in:
Fuzi_fauzia 2024-07-11 11:23:42 +07:00
parent 0b37bcd8ee
commit dc4be31103
2 changed files with 4 additions and 4 deletions

View File

@ -81,7 +81,7 @@
<div class="form-group col-md-6">
<label for="kwh" style="color: #ffffff">KWH:</label>
<input
type="number"
type="text"
class="form-control no-arrow"
id="kwh"
formControlName="kwh"
@ -89,7 +89,7 @@
[ngClass]="{'is-invalid': myForm.get('kwh').invalid && myForm.get('kwh').touched}"
/>
<div *ngIf="myForm.get('kwh').invalid && myForm.get('kwh').touched" class="text-danger">
KWH is required.
Please enter a valid KWH.
</div>
</div>
<div class="form-group col-md-6">

View File

@ -48,7 +48,7 @@ export class AddEditMasterBuildingComponent {
owner: ["", Validators.required],
address: ["", Validators.required],
phone: ["", [Validators.required, Validators.pattern(/^[0-9]{10,15}$/)]],
kwh: ["", Validators.required],
kwh: ["", [Validators.required, Validators.maxLength(20), Validators.pattern(/^[0-9]{10,15}$/)]],
});
}
@ -61,7 +61,7 @@ export class AddEditMasterBuildingComponent {
address: [this.dataRow.address, Validators.required],
phone: [this.dataRow.phone, [Validators.required, Validators.pattern(/^[0-9]{10,15}$/)]],
owner: [this.dataRow.owner,Validators.required],
kwh: [this.dataRow.kwh, Validators.required],
kwh: [this.dataRow.kwh, [Validators.required, Validators.maxLength(20), Validators.pattern(/^[0-9]{10,15}$/)]],
});
}