Titans - Breathfree Camp applied Validation like at least 1 brand should be non zero value
Specific Folder FTP Upload / ftp-deploy (push) Successful in 2m3s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 2m3s
Details
This commit is contained in:
parent
f7d738c639
commit
45b80c229c
|
|
@ -404,7 +404,41 @@
|
|||
|
||||
|
||||
$('#report-form').on('submit', function(event){
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
|
||||
// At least one brand should have value > 0
|
||||
let brandFields = [
|
||||
'#field-glycohale_f_capsules',
|
||||
'#field-glycohale_fb',
|
||||
'#field-foracort_g_400_rotacaps',
|
||||
'#field-glycohale_fb_inhaler',
|
||||
'#field-foracort_g_inhaler',
|
||||
'#field-glycohale_fb_synchrobreathe',
|
||||
'#field-foracort_g_synchrobreathe',
|
||||
'#field-glycohale_f_inhaler',
|
||||
'#field-glycohale_f_synchrobreathe',
|
||||
'#field-foracort_g_400_ciphaler',
|
||||
'#field-glycohale_fb_ciphaler'
|
||||
];
|
||||
|
||||
let hasValue = false;
|
||||
|
||||
brandFields.forEach(function(field) {
|
||||
if ((parseInt($(field).val()) || 0) > 0) {
|
||||
hasValue = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (!hasValue) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Validation Error',
|
||||
text: 'From all 11 brands, at least one field should be greater than 0.'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
const formData = new FormData($('#report-form')[0]);
|
||||
// Log form data to console
|
||||
for (let [key, value] of formData.entries()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue