相关疑难解决方法(0)

jquery对话框:确认单击提交按钮

我正在尝试使用jquery进行确认对话,但表单根本没有提交,这就是我得到的:

    <script type="text/javascript">
    var currentForm;
    $(function() {
        $("#dialog-confirm").dialog({
            resizable: false,
            height: 140,
            modal: true,
            autoOpen: false,
            buttons: {
                'Delete all items': function() {
                    currentForm.submit();
                    $(this).dialog('close');
                },
                Cancel: function() {
                    $(this).dialog('close');
                }
            }
        });
    });

    function ask() {
        currentForm = $(this).closest('form');
        $("#dialog-confirm").dialog('open');
    }
</script>
<form ... >
    <input type="submit" value="delete" onclick="ask();return false;" />
</form>
Run Code Online (Sandbox Code Playgroud)

jquery

8
推荐指数
2
解决办法
4万
查看次数

标签 统计

jquery ×1