如何在保存按钮中关闭对话框? [英] How to close dialog box in save button?

查看:119
本文介绍了如何在保存按钮中关闭对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在尝试关闭保存按钮时关闭对话框。



我正在使用带有reffer的引导程序对话框 http://getbootstrap.com/javascript/ [ ^ ]

这个网站。



关闭对话框的代码:



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





第一次它会起作用,但下次按下保存按钮然后出现错误,如



 TypeError:b.preventDefault  不是函数


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





那怎么能解决这个错误。



谢谢,

解决方案

('#save')。modal('hide');





第一次它会工作但是下次按保存按钮,然后生成错误,例如



 TypeError:b.preventDefault  不是函数


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





那怎么能解决这个错误。



谢谢,


除非我们看到你的代码,否则我们无法预测你是如何激活模态的。可能就像这样帖子说,



引用:

在不编写JavaScript的情况下激活模态。在控制器元素上设置data-toggle =modal,如按钮,以及data-target =#foo或href =#foo,以定位要切换的特定模态。





可能您已经同时使用这两种方式,

 <   a     href   =' #'    id   ='  launchReportModal'    data-toggle   ='  modal'     data-target   =' #reportModal' >  report <   / a  >  









 


' #launchReportModal')。on(' 单击 function (){

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

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,

解决方案

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



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

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,


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,

<a href='#' id='launchReportModal' data-toggle='modal' data-target='#reportModal'>report</a>



and


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


这篇关于如何在保存按钮中关闭对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆