Need help with an onsubmit return script that will check 2 functions
I am trying to prevent submission of a form if either or both of 2 functions return false. I've tried calling the functions in my form this way:
<form action="tuition-calculator.php" name="orderform" id="tuition-schedule" method="post" onsubmit="return (tuesThurs() && setTuition())">, but it doesn't stop the submission, even if the results are false.
So...now I've tried this:
var result = tuesThurs(myForm);
var result2 = setTuition(myForm);
results = result && result2;
If the values are "false" for both functions, the proper alerts appear and the submission doesn't happen. If I change my entries so that tuesThurs returns a "true" but setTuition returns a false, the alert for setTuition appears, but the submission goes through anyway. I do not want it to be submitted until both functions are true.