The link below calls the DeleteUser function and displays the message below. When the link is clicked again, the message repeats, and continues to do so each time the link is clicked. Is there a way to stop this behavior? I have tried to hide the link after it is clicked once, but the element remains, so when another link that shares this message box is clicked, the first message is still displayed.
<a href="#" onclick="DeleteUser('{id}','{deleting}')">Delete User</a>
function DeleteUser(id, deleting){
var message = "<h1>Are you sure? All records associated with this user will be deleted also.</h1>";
$('#managermsg').append(message);
$('#managermsg').fadeIn(500);
$("#usermanager").slideToggle("slow");
};
change from
append()totext()orhtml()with append you add it every time, with these others you will replace whats already there.