Click here to Skip to main content
15,849,197 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I am trying to close dialog box when save botton is press.

I am using bootstrap dialog box with reffer[^]
this site.

Code for close dialog box:


First time it will work but next time press save button then error genrated like

TypeError: b.preventDefault is not a function


So how can solve this error.

Abhishek Pant 1-Jan-15 3:57am    
Please check that the Duplication of the bootstrap.js files or This can also be caused if you include bootstrap.js before jquery.js.
Mayank Engineer 1-Jan-15 4:19am    
Abhishek Pant 1-Jan-15 4:29am    
Did it helped?

1 solution

Unless we see your code we can't predict how you activated the modal.May be as this post says,

Activate a modal without writing JavaScript. Set data-toggle="modal" on a controller element, like a button, along with a data-target="#foo" or href="#foo" to target a specific modal to toggle.

May be you have use both the ways,
<a href='#' id='launchReportModal' data-toggle='modal' data-target='#reportModal'>report</a>


$('#launchReportModal').on('click', function(){

JS Fiddle Demo

Source : From here
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900