PD Loan Form Validation : ps
This commit is contained in:
parent
98590c363f
commit
cc9cbd52e1
@ -24,7 +24,7 @@
|
|||||||
<input matInput placeholder="Specify End Use" formControlName="end_use_other">
|
<input matInput placeholder="Specify End Use" formControlName="end_use_other">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<mat-select placeholder="Is there a balance transfer"
|
<mat-select placeholder="Is there a balance transfer" (selectionChange)="selectedBalancesTransferChanges($event)"
|
||||||
formControlName="is_transfer" required>
|
formControlName="is_transfer" required>
|
||||||
<mat-option value="yes">Yes</mat-option>
|
<mat-option value="yes">Yes</mat-option>
|
||||||
<mat-option value="no">No</mat-option>
|
<mat-option value="no">No</mat-option>
|
||||||
|
|||||||
@ -170,7 +170,8 @@ getM_sourceofamount() {
|
|||||||
end_use: ['', Validators.compose([Validators.required])],
|
end_use: ['', Validators.compose([Validators.required])],
|
||||||
end_use_other: [''],
|
end_use_other: [''],
|
||||||
is_transfer: ['', Validators.compose([Validators.required])],
|
is_transfer: ['', Validators.compose([Validators.required])],
|
||||||
is_topup: ['', Validators.compose([Validators.required])],
|
//is_topup: ['', Validators.compose([Validators.required])],
|
||||||
|
is_topup: [''],
|
||||||
balance_transfer_amount: [''],
|
balance_transfer_amount: [''],
|
||||||
topup_amount: [''],
|
topup_amount: [''],
|
||||||
lender: [''],
|
lender: [''],
|
||||||
@ -204,6 +205,7 @@ getM_sourceofamount() {
|
|||||||
submitLoanDetails() {
|
submitLoanDetails() {
|
||||||
console.log('formData', this.loanDetailsForm.value);
|
console.log('formData', this.loanDetailsForm.value);
|
||||||
if (!this.loanDetailsForm.valid) {
|
if (!this.loanDetailsForm.valid) {
|
||||||
|
//this.notifier.notify('warning', 'Form Invaild Check all requried Field .!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let records: any = {};
|
let records: any = {};
|
||||||
@ -269,6 +271,23 @@ getM_sourceofamount() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
selectedBalancesTransferChanges(event: any){
|
||||||
|
// console.log('First Time',event);
|
||||||
|
// console.log('First Time Value',event.value);
|
||||||
|
if(event.value == 'no') {
|
||||||
|
this.loanDetailsForm.controls['is_topup'].clearValidators();
|
||||||
|
this.loanDetailsForm.controls['is_topup'].updateValueAndValidity();
|
||||||
|
// console.log('no',event.value);
|
||||||
|
}
|
||||||
|
else if(event.value == 'yes'){
|
||||||
|
this.loanDetailsForm.controls['is_topup'].setValidators([Validators.required]);
|
||||||
|
this.loanDetailsForm.controls['is_topup'].updateValueAndValidity();
|
||||||
|
// console.log('yes',event.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/** On Key Press Event For Amount */
|
/** On Key Press Event For Amount */
|
||||||
keyPress(event: any) {
|
keyPress(event: any) {
|
||||||
const pattern = /[0-9]/;
|
const pattern = /[0-9]/;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user