From ad943d2291262c07662a5203f3f8c2ec54a195ba Mon Sep 17 00:00:00 2001 From: VeritasLuxMea Date: Sun, 22 Aug 2021 09:10:06 -0500 Subject: [PATCH] fix: correct form for confirmform (#578) --- src/resources/js/seat.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/resources/js/seat.js b/src/resources/js/seat.js index bbed96537..ce1c39c4c 100644 --- a/src/resources/js/seat.js +++ b/src/resources/js/seat.js @@ -10,7 +10,11 @@ $.ajaxSetup({ // Make your submit button part of class confirmform, and viola var currentForm; $(document).on("click", ".confirmform", function (e) { - currentForm = $(this).closest("form"); + if ($(this).attr('form') === undefined) { + currentForm = $(this).closest("form"); + } else { + currentForm = $('#'.concat($(this).attr('form'))) + } e.preventDefault(); bootbox.confirm("Are you sure you want to continue?", function (confirmed) { if (confirmed) { @@ -24,7 +28,11 @@ $(document).on("click", ".confirmform", function (e) { // You can add an entity name by adding a "data-seat-entity" attribute. var currentForm; $(document).on("click", ".confirmdelete", function (e) { - currentForm = $(this).closest("form"); + if ($(this).attr('form') === undefined) { + currentForm = $(this).closest("form"); + } else { + currentForm = $('#'.concat($(this).attr('form'))) + } e.preventDefault(); entity = $(this).data('seat-entity'); if (typeof entity !== 'undefined') {