使用php更新和重新加载mysql-删除确认问题

时间:2019-04-05 21:25:04

标签: php

当我提交它要求确认时,我曾尝试删除一些代码,但无法正常工作。

我想提交,并且更新时没有被要求。

        $('body').on("change",'.guests_left',function(){
            var value = $(this).val();
            var id = $(this).data("id");
            var location = 'updateLeftGuests.php?sheet_id='+id+'&guests_left='+value;
            var txt;
            var r = confirm("This will change remaining guests, Are you sure?");

            if (r == true) {
                window.location.href = location;
            } else {
                location.reload();
            }

        });
    }
} );
</script>

1 个答案:

答案 0 :(得分:3)

改为使用此:

$('body').on("change",'.guests_left',function(){
    var value = $(this).val();
    var id = $(this).data("id");
    var location = 'updateLeftGuests.php?sheet_id='+id+'&guests_left='+value;
    var txt;
    window.location.href = location;
});
相关问题