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 8900113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:01:37+00:00 2026-06-15T01:01:37+00:00

I went through all possible questions related to Twitter Bootstrap modals but my problem

  • 0

I went through all possible questions related to Twitter Bootstrap modals but my problem is kind of unique over here.

I have included the files from the latest bootstrap release, so my public directory has –

css/
| bootstrap.css
| bootstrap.min.css

js/
| bootstrap.js
| bootstrap.min.js

I am also using Select2 and I have checked that it is not interfering with the bootstrap files.

My modals are defined this way –

<div class="modal hide fade" id="modal-<?php echo $user_role->id ?>" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3>Update &ldquo;{{ $user_role->role_name }}&rdquo;</h3>
    </div>
    <div class="modal-body">
        <label>New Value</label>
        <input type="hidden" name="inputId" value="<?php echo $user_role->id ?>">
        <input type="text" name="inputUpdate" value="<?php echo $user_role->role_name ?>" autofocus>
    </div>
    <div class="modal-footer">
        <a href="#" class="btn" data-dismiss="modal" aria-hidden="true">Cancel</a>
        <a rel="update" href="<?php echo url('admin/dashboard/controls/update_master') ?>" class="btn btn-primary">Update</a>
    </div>
</div>

And to call the modal, the button is defined like this –

<a rel="edit" data-toggle="modal" href="#modal-<?php echo $user_role->id ?>" class="btn btn-info">Edit</a>

The JS that runs on the page is –

$(document).ready(function() {
    var urlModal;
    $('a[rel="edit"]').click(function() {
        urlModal = $(this).attr('href');
        $(urlModal).modal();
    });
});

Whenever I click on the <a rel="edit"> button, the modal appears and immediately goes away.

  • 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-15T01:01:38+00:00Added an answer on June 15, 2026 at 1:01 am

    I just figured out the problem.

    $('a[rel="edit"]').click(function() {
        urlModal = $(this).attr('href');
        $(urlModal).modal();
    });
    

    The $(urlModal).modal(); part wasn’t required. The code in the HTML part of the button, itself shoots the modal. And this query was closing it.

    Now, its working.

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

Sidebar

Related Questions

This seem to be a common problem and I went through all the related
I went through all the posts on reflection but couldn't find the answer to
I went through all the answered threads on rewrite rule problem. Tried the suggestions,
I'm currently following: http://railsontherun.com/2007/10/04/sexy-charts-in-less-than-5-minutes/ I went through it all pretty easily, but then when
Introduction I'm relatively new to C++. I went through all the basic stuff and
I went through all the steps with eclipse indigo, and I can't seem to
I went through all the articles about the INSTALL_FAILED_MISSING_SHARED_LIBRARY issue in Google Maps projects
I made a movieclip symbol called SwordHolder then went through ALL my animations and
I've signed up for Urban Airship and went through all of the tutorials and
I'm not even sure if this is possible or not, but here's what I'd

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.