#1
  1. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,216
    Rep Power
    220

    Keeping Bootstrap Modal Open And Open On Page


    Hi;

    I use Bootstrap modal and want it to be open on page load.

    I open it with this
    Code:
    $( document ).ready(function() {  
    $('#login-modal').modal('show');
    });
    Currently, when I click anywhere on the page, it closes the modal. I don't want the user to be able to close it. Basically, I wanna make it compulsory to fill the
    form inside the modal or leave the page.

    How can I achieve that?

    Thanks
  2. #2
  3. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,216
    Rep Power
    220
    Found it.

    Just needed data-backdrop="static"!

    Code:
    <div class="modal fade" id="login-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;"  data-backdrop="static" data-keyboard="false">
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2017
    Posts
    7
    Rep Power
    0
    perfect! thanks for answer i have been looking for this

IMN logo majestic logo threadwatch logo seochat tools logo