Forum Moderators: open
/*
* Kills an event's propagation and default action
*/
function knackerEvent(eventObject) {
if (eventObject && eventObject.stopPropagation) {
eventObject.stopPropagation();
}
if (window.event && window.event.cancelBubble ) {
window.event.cancelBubble = true;
}
if (eventObject && eventObject.preventDefault) {
eventObject.preventDefault();
}
if (window.event) {
window.event.returnValue = false;
}
}
Probably the easiest way to accomplish that is to apply the initial code to the object's event property and then simply reassign it as you wish.
Instead of preventing the knackerEvent function, is it possible to undo/repair what it did, after it has executed? Is a counter-function to knackerEvent() possible? Or does RT's post above mean that these commands don't work like that?
I realise now that the form disabling does not happen with the knackerEvent function - it does something else. The form input disabling happens on lines like this:
target.getElementsByTagName('select')[0].disabled = true;
target.getElementsByTagName('input')[0].disabled = true;