【问题标题】:jquery submit() on alertify confirm not firingjquery submit() on alertify 确认不触发
【发布时间】:2017-10-18 17:46:03
【问题描述】:

谁能告诉我为什么我的 submit() 没有触发?

如果我尝试删除 alertify.confirm() 只需使用我的 submit() 即可。

$('.myBtn').click(function(){
    alertify.confirm("Confirmation",function(e){
        if(e){
            $(this).closest('form').submit();
        }else{
             alertify.error('Nope');
        }
    });
});

【问题讨论】:

  • 你能添加你的代码sn-p吗?
  • 您的按钮是按钮按钮、提交按钮还是只是按钮。

标签: jquery submit confirm alertify


【解决方案1】:

这是我发现的最相似的方法。 $('.myBtn') 是表单内的普通按钮。 我用一个类来称呼它,因为它们是一组表单。

$('.myBtn').click(function(){
$btn = $(this);
alertify.confirm("Confirmation",function(e){
    if(e){
        $btn.closest('form').submit();
    }else{
         alertify.error('Nope');
    }
});

});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-20
    • 2013-03-30
    相关资源
    最近更新 更多