...

View Full Version : Problem with form onSubmit



Mwnciau
01-14-2007, 01:35 AM
I have the following code on the onSubmit part of my form and when I click submit if I have two different things in the password section the alert comes up, but if I do the same with the email or the checkbox it carries on as normal, even if I put return false at the end. I'm pretty new to javascript, but have lots of PHP experience, and can't find what's wrong. Thanks for any replies.


<script>
function checksubmit(){
if (document.create.password.value != document.create.confirmpassword.value){
alert('Your two passwords do not match.');
return false;
}
if (document.create.email.value != document.confirmemail.value){
alert('Your two emails do not match.');
return false;
}
else if (!document.create.tac.checked){
alert('You have to agree to the terms and conditions.');
return false;
}
return false;
}
</script>

Mwnciau
01-14-2007, 02:07 AM
fixed



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum