Skip to content

Commit

Permalink
fix: correct form for confirmform (#578)
Browse files Browse the repository at this point in the history
  • Loading branch information
veteranmina committed Aug 22, 2021
1 parent f289c81 commit ad943d2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/resources/js/seat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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') {
Expand Down

0 comments on commit ad943d2

Please sign in to comment.