function confirmLogin(form) { if (form.username.value.length == 0) { alert("You need to enter a username"); return false; } if (form.password.value.length == 0) { alert("You need to enter a password"); return false; } if (form.password2.value.length == 0) { alert("You need to enter a copy of your password"); return false; } if (form.email.value.length == 0) { alert("You need to enter your email address"); return false; } if (form.password.value != form.password2.value) { alert("Your copy of the password is different"); return false; } form.submit(); }