What Is the Opposite of Evt.Preventdefault();

Is there an opposite function of preventDefault() in JavaScript?

I think the problem you are having is that you are not looking for the delete key. Preventdefault does not cancel the event handler all together. But with your code once you hit the maximum length of your field the user will no longer be able delete any characters because the delete keypress is being cancelled.

The reason it works in IE is because IE does not fire the keypress event for delete, end, enter, escape, function keys, home, insert, pageUp/Down and tab. In Safari the keycode for delete is incorrect in the keypress event.

For these reasons I have a twofold suggestion; first, use the keydown event instead so that you get the correct keycodes.

Second, look at the keycode and if it is delete or backspace then don't preventDefault.

if ((event.keyCode != 46 && event.keyCode != 8) || input_length > (wordNum - 1)) {
return false;
} else {
return true;
}

Opposite of e.preventDefault and e.stopPropagation();

Fixed by unbinding the event.

Focus

    $('.form-control').focus(function() {  
$('#element').on('scroll touchmove mousewheel', function(e){
e.preventDefault();
e.stopPropagation();
})
});

Focus out

$('.form-control').focusout(function() {
$('#element').unbind();
});

Undo preventDefault() method

You can't undo the e.preventDefault() as you are dealing with a later instance of e by the time you submit.

return false does the same as e.preventDefault() and e.stopPropagation(), so you can simplify your code a little though by simply returning your flag.

var $form = $('form');
var canSubmit = false;

$form.data('working', false);
$form.submit(function(e){
if (form.validations.form($form)) {
if (!$form.data('working')) {
$form.data('working', true);
if (!canSubmit) {
e.preventDefault();
$.get(BASE+'file.txt', function(response){
canSubmit = true;
$form.submit(); // trigger recursive call
});
}
}
} else {
$form.data('working', false);
}
return canSubmit;
});

event.preventDefault() vs. return false

return false from within a jQuery event handler is effectively the same as calling both e.preventDefault and e.stopPropagation on the passed jQuery.Event object.

e.preventDefault() will prevent the default event from occuring, e.stopPropagation() will prevent the event from bubbling up and return false will do both. Note that this behaviour differs from normal (non-jQuery) event handlers, in which, notably, return false does not stop the event from bubbling up.

Source: John Resig

Any benefit to using event.preventDefault() over "return false" to cancel out an href click?

Opposite of PreventDefault() : Continuing ActionLink logic

You can trigger the event again:

 $('#NameOfButton').bind('click', function (e, skip) {
if (skip) return; // check param

e.preventDefault(); // Stop click event

//Gather Data
var data = $(this).parents('form').first().serialize();

var el = $(this);
//Check Data , if saved to DB continue Click functionality
$.ajax({
url: '<%:Url.Action("Get")%>',
cache: false,
type: 'POST',
data: data,
success: function (result) {
if (result.Success == true) {
console.log('true');
el.trigger('click', [true]); // trigger same event with additional param
} else {
//do nothing
console.log('false');
}
}
});
});

What's the difference between event.stopPropagation and event.preventDefault?

stopPropagation prevents further propagation of the current event in the capturing and bubbling phases.

preventDefault prevents the default action the browser makes on that event.

Examples

preventDefault