Team 3 (Images Upload Chnages)

This commit is contained in:
zeeshan 2026-08-17 17:58:50 +05:30
parent 4091d211b0
commit e5c374b311
4 changed files with 67 additions and 10 deletions

View File

@ -261,9 +261,35 @@
);
$('#execution-total_camp_rx').val(total)
})
})
$('#field-upload_invoice_photo,#field-upload_invoice_photo_2,#field-upload_invoice_photo_3')
.attr('accept', '.jpg,.jpeg,.png,.pdf');
$('#field-upload_invoice_photo,#field-bag_distribution_photo ').on('change', function () {
$('#field-bag_distribution_photo')
.attr('accept', '.jpg,.jpeg,.png');
const maxSize = 10 * 1024 * 1024; // 10 MB
$('#field-upload_invoice_photo,#field-bag_distribution_photo_jpgjpegpng_max_upto_10_mb,#field-upload_invoice_photo_2,#field-upload_invoice_photo_3')
.on('change', function () {
const file = this.files[0];
if (!file) return;
if (file.size > maxSize) {
Swal.fire({
icon: 'error',
title: 'File Too Large',
text: 'Maximum file size allowed is 10 MB.'
});
$(this).val('');
}
});
/* $('#field-upload_invoice_photo,#field-bag_distribution_photo ').on('change', function () {
let file = this.files[0];
if (file) {
@ -284,7 +310,7 @@
return;
}
}
});
}); */
$('#field-phone_no_of_staff')
.closest('.col-md-12')

View File

@ -261,9 +261,38 @@
);
$('#execution-total_camp_rx').val(total)
})
})
$('#field-upload_invoice_photo,#field-bag_distribution_photo ').on('change', function () {
$('#field-upload_invoice_photo,#field-upload_invoice_photo_2,#field-upload_invoice_photo_3')
.attr('accept', '.jpg,.jpeg,.png,.pdf');
$('#field-bag_distribution_photo')
.attr('accept', '.jpg,.jpeg,.png,.pdf');
const maxSize = 10 * 1024 * 1024; // 10 MB
$('#field-upload_invoice_photo,#field-bag_distribution_photo,#field-upload_invoice_photo_2,#field-upload_invoice_photo_3')
.on('change', function () {
const file = this.files[0];
if (!file) return;
if (file.size > maxSize) {
Swal.fire({
icon: 'error',
title: 'File Too Large',
text: 'Maximum file size allowed is 10 MB.'
});
$(this).val('');
}
});
/*$('#field-upload_invoice_photo,#field-bag_distribution_photo,').on('change', function () {
let file = this.files[0];
if (file) {
@ -284,7 +313,7 @@
return;
}
}
});
});*/
$(document).ready(function () {
$('#field-contact_id').trigger('change');

View File

@ -300,7 +300,7 @@
$(this).val('');
}
});
$('#field-upload_invoice_photo_max_10_mb')
$('#field-upload_invoice_photo_max_10_mb,#field-upload_invoice_photo_2,#field-upload_invoice_photo_3')
.attr('accept', '.jpg,.jpeg,.png,.pdf');
/*
@ -309,11 +309,11 @@
accept: 'image/*',
}); */
$('#field-bag_distribution_photo_jpgjpegpng_max_upto_10_mb')
.attr('accept', '.jpg,.jpeg,.png,.pdf');
.attr('accept', '.jpg,.jpeg,.png');
const maxSize = 10 * 1024 * 1024; // 10 MB
$('#field-upload_invoice_photo_max_10_mb, #field-bag_distribution_photo_jpgjpegpng_max_upto_10_mb')
$('#field-upload_invoice_photo_max_10_mb,#field-bag_distribution_photo_jpgjpegpng_max_upto_10_mb,#field-upload_invoice_photo_2,#field-upload_invoice_photo_3')
.on('change', function () {
const file = this.files[0];

View File

@ -250,7 +250,7 @@
});
$('#field-upload_invoice_photo_max_10_mb').on('change', function () {
$('#field-upload_invoice_photo_max_10_mb,#field-upload_invoice_photo_2,#field-upload_invoice_photo_3').on('change', function () {
const file = this.files[0];
if (!file) return;
@ -305,6 +305,8 @@
});
/* $('#field-input_name,#field-input_given_count').on('change',function(){
$('#report-form input.dynamic-hidden').remove();
$('#report-form').append('<input type="hidden" class="dynamic-hidden" name="'+ $('#field-input_name').val() +'" value="1">')