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

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

I am using bootstrap dialog box with reffer http://getbootstrap.com/javascript/[^]
this site.

Code for close dialog box:

$('#save').modal('hide');


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

C#
TypeError: b.preventDefault is not a function


...(e)}))},b.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.mo...


So how can solve this error.

Thanks,
Posted
Comments
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    
Thanks
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,

Quote:
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,
HTML
<a href='#' id='launchReportModal' data-toggle='modal' data-target='#reportModal'>report</a>


and

JavaScript
$('#launchReportModal').on('click', function(){
    $('#reportModal').modal();
});


JS Fiddle Demo

Source : From here
 
Share this answer
 
v2

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