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?
__________________
I have a Please login or register to view this content. Registration is FREE and I write about Please login or register to view this content. Registration is FREE , Please login or register to view this content. Registration is FREE and Please login or register to view this content. Registration is FREE .
Well, validator is the function that I have for a small form.
I'm calling it this way (the function is in a speratate file that I have declared it in header):
__________________
I have a Please login or register to view this content. Registration is FREE and I write about Please login or register to view this content. Registration is FREE , Please login or register to view this content. Registration is FREE and Please login or register to view this content. Registration is FREE .
Last edited by RedPitbull; 07-12-2012 at 01:04 PM..
So what is the script element in that code supposed to be doing?
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?