| Line 70... |
Line 70... |
| 70 |
});
|
70 |
});
|
| 71 |
|
71 |
|
| 72 |
|
72 |
|
| 73 |
$(document).on('click', ".mk_submit_loi_form", function () {
|
73 |
$(document).on('click', ".mk_submit_loi_form", function () {
|
| 74 |
// Gather input values
|
74 |
// Gather input values
|
| - |
|
75 |
const onboardingType = $('input[name="loiOnboardingType"]:checked').val() || 'NEW';
|
| - |
|
76 |
const oldStoreCode = $('#loiOldStoreCode').val() ? $('#loiOldStoreCode').val().trim() : '';
|
| - |
|
77 |
const revivalReason = $('#loiRevivalReason').val() ? $('#loiRevivalReason').val().trim() : '';
|
| 75 |
const referId = $('select[name="referId"]').val();
|
78 |
const referId = $('select[name="referId"]').val();
|
| 76 |
const stateHead = $('select[name="stateHead"]').val();
|
79 |
const stateHead = $('select[name="stateHead"]').val();
|
| 77 |
const bdm = $('select[name="bdm"]').val();
|
80 |
const bdm = $('select[name="bdm"]').val();
|
| 78 |
let billingAddress = $('select[name="billingAddress"]').val();
|
81 |
let billingAddress = $('select[name="billingAddress"]').val();
|
| 79 |
if(!billingAddress){
|
82 |
if(!billingAddress){
|
| Line 181... |
Line 184... |
| 181 |
const paymentReferenceNo = $('input[name="paymentReferenceNo"]').val();
|
184 |
const paymentReferenceNo = $('input[name="paymentReferenceNo"]').val();
|
| 182 |
const feeCollectingDate = $('input[name="feeCollectingDate"]').val();
|
185 |
const feeCollectingDate = $('input[name="feeCollectingDate"]').val();
|
| 183 |
const paymentAttachment = $('input[name="paymentAttachment"]').val();
|
186 |
const paymentAttachment = $('input[name="paymentAttachment"]').val();
|
| 184 |
|
187 |
|
| 185 |
let missingFields = [];
|
188 |
let missingFields = [];
|
| - |
|
189 |
if (onboardingType !== 'NEW') {
|
| - |
|
190 |
if (!revivalReason) {
|
| - |
|
191 |
missingFields.push(onboardingType === 'ANY_OTHER' ? 'Reason (Any Other)' : 'Reason for Revival');
|
| - |
|
192 |
}
|
| - |
|
193 |
if (onboardingType === 'REVIVAL' && !oldStoreCode) {
|
| - |
|
194 |
missingFields.push('Old Store Code (required for Revival)');
|
| - |
|
195 |
}
|
| - |
|
196 |
}
|
| 186 |
if (!firstName) missingFields.push('First Name');
|
197 |
if (!firstName) missingFields.push('First Name');
|
| 187 |
if (!lastName) missingFields.push('Last Name');
|
198 |
if (!lastName) missingFields.push('Last Name');
|
| 188 |
if (mobile.length < 10 || !mobile) {
|
199 |
if (mobile.length < 10 || !mobile) {
|
| 189 |
missingFields.push('Mobile number should be 10 digit');
|
200 |
missingFields.push('Mobile number should be 10 digit');
|
| 190 |
}
|
201 |
}
|
| Line 244... |
Line 255... |
| 244 |
if (missingFields.length > 0) {
|
255 |
if (missingFields.length > 0) {
|
| 245 |
alert('The following fields are required: ' + missingFields.join(', '));
|
256 |
alert('The following fields are required: ' + missingFields.join(', '));
|
| 246 |
return;
|
257 |
return;
|
| 247 |
}
|
258 |
}
|
| 248 |
const loiFormData = {
|
259 |
const loiFormData = {
|
| - |
|
260 |
onboardingType: onboardingType,
|
| - |
|
261 |
oldStoreCode: oldStoreCode,
|
| - |
|
262 |
revivalReason: revivalReason,
|
| 249 |
referId: referId,
|
263 |
referId: referId,
|
| 250 |
stateHead: stateHead,
|
264 |
stateHead: stateHead,
|
| 251 |
bdm: bdm,
|
265 |
bdm: bdm,
|
| 252 |
businessType: businessType,
|
266 |
businessType: businessType,
|
| 253 |
acquiredDate: acquiredDate,
|
267 |
acquiredDate: acquiredDate,
|