I am creating a pop-up modal in worker portal for foreign worker. I should make a pop up modal by asking them your contract end date will expiring within the within next 6 months based on today date of months left for their contract end date to expired based on today date. Are you wish to extend your contract ? The pop up modal will only appear by detecting their contract_end_date and compare with today date, if today date and contract end date is within six months then only the pop-up modal will appear. I already knows the worker contract end date .In order to identify their contract end date, we are taking arrival date compare with the plks. If the duration is less than 2 years, the contract end date is the plks + 1 year. If the duration is more than 2 years, the contract end date is equal to plks. Now all working fine but if the user click No and the user must enter the reason. If the user never enter anything and click submit, it should prompt an validation message "Please enter your reason for not renewing the contract". In my case, it not showing
This is my code
showLoaderOnConfirm: true,
preConfirm: (reason) {
if (!reason) {
swal.showValidationMessage("Please enter your reason for not renewing the contract");
} else {
submitSurveResult('No', formattedContractEndDate);
}
}