I have an HTML table that displays rows of records and has a column at the end with a delete link. Each delete link has a confirmation-delete class. I need the confirmation pop-up dialog box to click and, since it is used on multiple pages, to create a confirmation function in an external JS file.
I added a function call to the link using jQuery [the code at the bottom of the message], and it works fine until the dialog is confirmed after [user clicked OK]. Then the function is no longer called.
I think I am missing something quite simple, although since I am not using JS / jQuery, I may have a gap in my knowledge. Why does it work fine until the first OK? It seems to be storing a link to the result and reusing it, rather than unique to each link.
Here is the code used on the Notes page:
$(function() { // Add Confirmation dialogs for all Deletes $("a.confirm-delete").click(function(event) { return fConfirmDelete('Note'); }); });
And the fConfirmDelete function
function fConfirmDelete( deleteObj ) { return confirm('Are you sure you wish to delete this ' + deleteObj + '?'); }
jquery onclick confirm
Rich
source share