Merge branch 'main' of http://192.168.1.200:3000/Stratawiz/Rapport-Laravel
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m1s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m1s
Details
This commit is contained in:
commit
d46cc0974d
|
|
@ -404,7 +404,41 @@
|
||||||
|
|
||||||
|
|
||||||
$('#report-form').on('submit', function(event){
|
$('#report-form').on('submit', function(event){
|
||||||
|
|
||||||
event.preventDefault();
|
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]);
|
const formData = new FormData($('#report-form')[0]);
|
||||||
// Log form data to console
|
// Log form data to console
|
||||||
for (let [key, value] of formData.entries()) {
|
for (let [key, value] of formData.entries()) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue