Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9104971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:59:12+00:00 2026-06-17T01:59:12+00:00

Twitter Bootstrap has the ability to call modals via data attributes, which is nice,

  • 0

Twitter Bootstrap has the ability to call modals “via data attributes”, which is nice, but I am not sure how to turn them off or replace the button’s event.

Example of setting up via attributes:

<button id="launch-btn" type="button" data-toggle="modal" data-target="#myModal">
   Launch modal
</button>

I’ve tried:

$('#launch-btn').off('click');
$('#launch-btn').unbind('click');
$('#launch-btn').on('click', function(e){e.preventDefault();});

But all seem to still open the modal. I want to prevent the default modal from opening and replace it with another action if a condition is met. I know I can use the modal’s show event to prevent displaying, but I don’t want to do that here, I want to control the behavior from the button.

I also realize it might be easier to handle the creation of the modal on-the-fly instead using JS instead of letting bootstrap handle it via the data attributes, but I’m now a curious george and am trying to discover what I’m doing wrong.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T01:59:13+00:00Added an answer on June 17, 2026 at 1:59 am

    This works: $(document).off('click.modal.data-api', '[data-toggle="modal"]');

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I thought text-align works in Twitter Bootstrap but it doesn't? I'm not sure what's
Twitter has released a GUI framework/library called Bootstrap. Twitter Bootstrap is good quality, nice-looking,
I have a basic HTML page which has Twitter Bootstrap, I am using the
I am using twitter bootstrap, and have a row which has two columns (span6).
Twitter Bootstrap has a form control that would glow on the borders when in
I'm using the Twitter Bootstrap fixed layout where the container div has: margin-left: auto;
I am using twitter bootstrap and have a fixed nav bar. The navbar has
Using Twitter Bootstrap's bootstrap-tab.js, I have: <ul class=tabnavcenter id=myTab> <li class=active><a href=#home data-toggle=tab>about</a></li> <li><a
Using Twitter Bootstrap's [Tabbable Tabs][1], it says to: Enable tabbable tabs via javascript (each
Hi I am using twitter bootstrap, and I am having two nav bar but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.