Closed PaulMcRoar closed 4 years ago
Hi,
The example jQuery code in the documentation for the destroy confirmation didn't work, not for me anyway. The message was always undefined.
What worked for me was using the jQuery 'on' method,
const destroyButton = $('form.destroy button[type="submit"]'); destroyButton.on('click', function(){ const message = $(this).data('confirm'); const form = $(this).closest('form'); if(confirm(message)) { form.submit(); } return false; });
Hope this helps.
Hi again @PaulMcRoar,
This has been fixed in https://github.com/Okipa/laravel-table/pull/57.
Thanks !
Hi,
The example jQuery code in the documentation for the destroy confirmation didn't work, not for me anyway. The message was always undefined.
What worked for me was using the jQuery 'on' method,
const destroyButton = $('form.destroy button[type="submit"]'); destroyButton.on('click', function(){ const message = $(this).data('confirm'); const form = $(this).closest('form'); if(confirm(message)) { form.submit(); } return false; });
Hope this helps.