如何添加到按钮“jQuery确认”以确认工作

问题描述

使用 module 但点击“是”后没有发送任何内容。请解释一下。

 <form class="zaeb" action="" method="post" id="kek">
                    <input type="hidden" name="type" value="<?PHP echo $plan->id; ?>">
                    <button id="b12<?PHP echo $plan->id; ?>" type="submit" class="example2 btn btn-primary btn-lg btn-block" name="buy"><b>CLICK HERE TO PURCHASE</b></button>

jQuery:

                        $('button.example2').confirm({
title: 'Confirm!',content: 'Simple confirm!',buttons: {
    confirm: function () {
        $.alert('Confirmed!');
    },cancel: function () {
        $.alert('Canceled!');
    },somethingElse: {
        text: 'Something else',btnClass: 'btn-blue',keys: ['enter','shift'],action: function(){
            $.alert('Something else?');
        }
    }
}
});

我想做一个漂亮的形状。

解决方法

确认功能只提示确认消息,您应该更改

confirm: function () {
        $.alert('Confirmed!');
    },

confirm: function () {
            document.getElementById("kek").submit();
            $.alert('Confirmed!'); // may need to remove this
            
        },