Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

JavaScript Which one is the 'first button'?

chrisj

Bronze Coder
Upon trying to add this SweetAlert to this successfully working submit Form:

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:

New Threads

Buy us a coffee!

Back
Top Bottom