Code:
function checkIfTheFormIsReadyToBeSubmittedYetOrIfTheyMissedABit() {
// check stuff here...
if (everythingIsOk) {
return true;
}
return false;
}
document.getElementById("theForm").onsubmit = checkIfTheFormIsReadyToBeSubmittedYetOrIfTheyMissedABit;
// N.B. No brackets at the end of the line above is intentional - we want to assign the function, not the result of calling it :-)

Leave a comment: