Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

466
Views
Stop swal loading on success ajax request

I'm using sweetalert2 to pop up a dialog where users will input a pin. The problem I'm facing is that I want to stop the button clicked from loading when the ajax request is completed.

So far I've used

Swal.hideLoading() ;

And

Swal.stopLoading();

But it doesn't stop the loader

swal.fire({
    title : "Confirm Transfer! ", 
    html :  "Enter pin" ,
    icon : "warning", 
    input : "text", 
    confirmButtonText: 'Confirm', 
    showLoaderOnConfirm: true, //show button loader 
    preConfirm: (pin) => {
        return new Promise(function (resolve) { 
            $.ajax({
            //ajax request
                success:function(data) {
                    Swal.stopLoading(); // stop button from loading and return to default button text value
                } 
            })
        })
    }
}) 
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!