Search code examples
javascriptmodal-dialogbootstrap-modal

Why webpage with two modal not work, the first i click make frizze


In my page, I have two modals, when open the first modal made a frieze. I have one button for other modal

Why don't work is some limitation from bootstrap?


Solution

  • Each modal should be given a different id and each link should be targeted to a different modal id. So it should be something like that:

    <a href="#myModal" data-toggle="modal">
    ...
    <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>
    ...
    <a href="#myModal2" data-toggle="modal">
    ...
    <div id="myModal2" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>
    ...
    

    In this way, It will work. If you click the first link, it should pop-up the first modal and if you click the second - the second modal is popped up.