I have the following:
<input type="image" src="images/submit.jpg" width="70" height="30"
border="0" onclick="validateRegister()" />
It is inside a form where:
<form action="register_submit.php" name="register" id="register"
method="post">
At the end of validateRegister() I have:
if (msg.length 0) {
alert(msg);
} else {
document.register.submit();
}
after having built the msg based upon any errors. (It starts with
var msg = '';)
What I am happening is that it alerts the message of all the errors
because msg.length 0, but then it submits the page!!! Even if I
comment out the document.register.submit(), it still submits it.
How can it submit the page if not a single call is made to post and
there is not button for submit?