Close Bootstrap modal on form submit

后端 未结 13 1486
盖世英雄少女心
盖世英雄少女心 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:31

    If you do not want to use jQuery, make the button type a normal button and add a click listener pointing to the function you would like to execute, and send the form in as a parameter. The button would be as follows:

    Remember to remove: (ngSubmit)="yourSubmitFunction(yourForm)" from the form div if you use this method.

提交回复
热议问题