I understand that this is very stupid, but the code between tags just doesn't work.
I have a simple HTML registration form. And the js-code makes a simple check is any input is empty.
function validate()
{
if (document.forms.registration.email.value == "")
{
alert("You must provide an email address.");
return false;
}
else if (document.forms.registration.password1.value != document.forms.registration.password2.value)
{
alert("You must provide the same password twice");
return false;
}
else if (!document.forms.registration.agreement.checked)
{
alert("You must agree to ours terms and conditions");
return false;
}
return true;
}
For some reason the browser kind of ignores this code and submits the form, even if it's empty.
EDIT:(Added based on OP comment)
<form action="process.php" id="registration" method="get" onsubmit="return.validate();">
<!-- Other child elements of the form -->
</form>
return validate();. Check for javascript errors in your debugging console.