My goal is to have the Alert displays in the upload Form with choices, and when 'Yes' is chosen, the file submits. I this code where the Alert displays but when 'Yes' is chosen the Alert closes but the file doesn't submit:
And I this code where the Alert doesn't display but the file submits:
Any guidance with having the Alert display and when 'Yes' is chosen, the file submits...
JavaScript:
$('#submit-btn').on('click',function(e){
e.preventDefault();
var form = $('.pt_upld_page_frm');
swal.fire({
title: "Are you sure?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, submit it!",
closeOnConfirm: false
}).then((result) => {
if (result.isConfirmed) {$('.upload-form').submit(); }
});
});
And I this code where the Alert doesn't display but the file submits:
JavaScript:
$('#submit-btn').on('click',function(e){
e.preventDefault();
var form = $('.pt_upld_page_frm');
swal.fire({
title: "Are you sure?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, submit it!",
closeOnConfirm: false
}).then((result) => {
if (result.isConfirmed){
$('.upload-form').submit(); }
$('.upload-form').ajaxForm({
url: '{{LINK aj/ffmpeg-submit}}?hash=' + $('.main_session').val(),
beforeSend: function() {
$('#submit-btn').attr('disabled', true);
$('#submit-btn').val("{{LANG please_wait}}");
},
success: function(data) {
if (data.status == 200) {
window.location.href = '{{LINK home}}';
}
})
});
Any guidance with having the Alert display and when 'Yes' is chosen, the file submits...
Last edited: