Upon trying to add this SweetAlert to this successfully working submit Form:
I asked for help as to how I can get the alert to display longer than about 1 second(which is what it currently does), or essentially how can I delay or pause the beforeSend to give the Form submitter time to read the displayed message?
It was suggested "don't submit the form when they click the first button. Make that trigger the popup, then have the popup's button submit the form", which sounds good, I just don't know how to make that happen with this code. Any guidance with that is welcomed.
JavaScript:
$('#upload-form form').ajaxForm({
url: '{{LINK aj/ffmpeg-submit}}?hash=' + $('.main_session').val(),
beforeSend: function() {
$('#submit-btn').attr('disabled', true);
$('#submit-btn').val("{{LANG please_wait}}");
Swal.fire({
title: '<strong>HTML <u>example</u></strong>',
icon: 'info',
html:
'You can use <b>bold text</b>, ' +
'<a href="//sweetalert2.github.io">links</a> ' +
'and other HTML tags',
showCloseButton: true,
showCancelButton: true,
focusConfirm: false,
confirmButtonText:
'<i class="fa fa-thumbs-up"></i> Great!',
confirmButtonAriaLabel: 'Thumbs up, great!',
cancelButtonText:
'<i class="fa fa-thumbs-down"></i>',
cancelButtonAriaLabel: 'Thumbs down'
})
I asked for help as to how I can get the alert to display longer than about 1 second(which is what it currently does), or essentially how can I delay or pause the beforeSend to give the Form submitter time to read the displayed message?
It was suggested "don't submit the form when they click the first button. Make that trigger the popup, then have the popup's button submit the form", which sounds good, I just don't know how to make that happen with this code. Any guidance with that is welcomed.
Last edited: