Team 3 (Images Upload Chnages)
This commit is contained in:
parent
4091d211b0
commit
e5c374b311
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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">')
|
||||
|
|
|
|||
Loading…
Reference in New Issue