Close Bootstrap modal on form submit

后端 未结 13 1498
盖世英雄少女心
盖世英雄少女心 2020-12-08 07:08

I have a Bootstrap modal dialog which contains a form. The modal dialog contains a submit and a cancel button. Now on submit button click the form is submitted

13条回答
  •  余生分开走
    2020-12-08 07:26

    i make this code it work fine but once form submit model button not open model again say e.preventdefault is not a function..

    Use below code on any event that fire on submit form

                    $('.modal').removeClass('in');
                    $('.modal').attr("aria-hidden","true");
                    $('.modal').css("display", "none");
                    $('.modal-backdrop').remove();
                    $('body').removeClass('modal-open');
    

    you can make this code more short..

    if any body found solution for e.preventdefault let us know

提交回复
热议问题