Do we have any event like "onBeforeSomeEvent" in jQuery?
For Ex,
<input type='button' class='confirmdelete' onclick='delete();' value='DELETE' />
Now I want to show a custom dialog for confirmation. (I don't want to use default confirm method in JavaScript).
So I need something like,
$('.confirmdelete').onBeforeClick(function() {
if(true) //I show the custom dialog here and check some conditions.
return true;
return false;
});
The onclick
event should fire if I get 'true' from the onbeforeclick event.
Sorry, If I am confusing. May be like beforeActivate
in Accordion.