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

192
Views
Calling different functions after hiding a bootstrap modal depending on the button used to hide it

I am using a bootstrap modal in my project. It has a Confirm and a Cancel button. I am using a promisified function to call and hide the modal. It also has a backdrop(which if clicked closes the modal) and a cross(x) button in the modal header which also closes the modal.

I want to resolve the promise and return true if the modal was hidden by the click on the Confirm button and resolve with false if it was closed by either Cancel, backdrop click, or the cross button.

The event (hidden.bs.modal) exposed by Bootstrap doesn't provide the ability to identify the source(button) that was used to hide the modal and hence unable to customize actions for them.

How can I achieve the desired results? Are there any specific class names to pick just the backdrop, cross button? I can add click listeners to them separately maybe. I couldn't find those class names.

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!