简体   繁体   中英

Update & reload mysql using php - remove confirmation question

When I submit it asks to confirm, I have tried to remove the bit of code but wont work.

I want to submit and it updates with out been asked.

        $('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>

use this instead:

$('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;
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM