Menu
I have this pice of code:
[CODE]
function validator() {
var l1 = document.calculation.l1.value;
var l2 = document.calculation.l2.value;
var right = document.calculation.right.value;
if (l1 == null || l1 == “”) alert(“error “);
else if (l1 == null || l2 == “”) alert(“error”);
else if (l1 == null || right == “”) alert(“error”);
else if (right == 1) { alert(“Correct”); }
else { alert(“Incorrect incorect”); }
return false;
};
In Firefox is ok, but in Chrome the alert box is displayed before pressing the Submit button from my form. What can be wrong here?