This is probably a very simple question, but I can’t find the answer, so hopefully someone can help?
How do you cancel a click action if the user clicks ‘cancel’ in a confirm box?
I have this so far but can’t find what I need to fill in the blank.
jQuery('#doaction').click(function(e){
if(jQuery('#bulk-action-selection').val() === 'delete'){
var action = confirm('Are you sure you wish to delete the selected User Groups? This action cannot be undone.');
}
if(action === false){
{ Cancel the click and don't delete the items }
}
});
This should work.