Here is the code:
Expand|Select|Wrap|Line Numbers
- <SCRIPT LANGUAGE="JavaScript">
- function validateForm(form)
- {
- if (form.username.value == "")
- {
- alert('You did not enter a username!');
- form.username.focuse();
- location.reload();
- return false;
- }else{
- if (form.security_code.value != "DOOM34K10")
- {
- alert('You did not enter the correct security code!');
- form.security_code.focuse();
- location.reload();
- return false;
- }else{
- if (form.email.value == "") {
- alert('We need to contact you through email!');
- form.email.focus();
- location.reload();
- return false;
- }else{
- if (form.email.value == "someone@site.com") {
- alert('I am sure as heck that your email is not what you entered!');
- form.email.focus();
- location.reload();
- return false;
- }else{
- if (form.password1.value == "")
- {
- alert('You did not enter a password!');
- form.password1.focuse();
- location.reload();
- return false;
- }else{
- if (form.password2.value == "")
- {
- alert('You did not enter the second password!');
- form.password2.focuse();
- location.reload();
- return false;
- }else{
- if (form.password1.value != form.password2.value)
- {
- alert('The passwords you entered are diffrent!');
- form.password1.focuse();
- form.password2.focuse();
- location.reload();
- return false;
- }else{
- document.forms[0].submit();
- return true;
- }
- }
- }
- }
- }
- }
- }
- }
- </SCRIPT>