Disabling the Default Action
Join the Discussion
This ensures that the true or false value returned from the validate function is in turn returned to the onsubmit event handler in order to allow it to determine whether or not the form should in fact be passed to the action script.
if (e &&e.preventDefault) e.preventDefault();
else if (window.event && window.event.returnValue)
window.eventReturnValue = false;
A simple call to stopDef() passing the reference to the current event handler as a parameter will then disable any default action that the HTML will have otherwise performed.