javascriptcsstwitter-bootstrapmodal-dialog

prevent bootstrap modal window from closing on form submission


Hi I'm using Bootstrap for the first time and I can't get my modal form to stay open on clicking the submit button. I've searched SO but all related questions deal with slightly different issues (example below).

Disallow twitter bootstrap modal window from closing


Solution

  • look at => http://getbootstrap.com/2.3.2/javascript.html#modals

    use

    data-backdrop="static"
    

    or

    $("#yourModal").modal({"backdrop": "static"});
    

    Edit1 :

    on your link opening your modal ==>

    <a href="#" onclick="$('#yourModal').modal({'backdrop': 'static'});" class="btn btn-primary">yourModal</a>
    

    Edit2 :

    http://jsfiddle.net/BVmUL/39/