1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Javascript Help

Discussion in 'Web Design & Development' started by lumentec, Sep 28, 2008.

Thread Status:
Not open for further replies.
  1. lumentec

    lumentec Thread Starter

    Joined:
    Mar 23, 2008
    Messages:
    103
    See any problems?

    Code:
    <script type="text/javascript">
    
    function check() {
    if (document.signup.username.value=="" || document.signup.password.value=="" || document.signup.password2.value=="" || document.signup.email.value=="" || document.signup.name.value=="") {
    alert("Fill out all parts of the form.");
    }
    
    if else (document.signup.password.value != document.signup.password2.value) {
    alert("Passwords do not match.");
    }
    
    
    if else (document.signup.email.value.indexOf("@")<=0 || document.signup.email.value.indexOf(".")<=0) {
    alert("Invalid Email address. Enter a valid email address and re-submit.");
    }
    
    if else (document.signup.username.value.length<4 || document.signup.password.value.length<6 || document.signup.email.value.length<7) {
    alert("Username must be at least 4 characters long. /n Password must be at least 6 characters long. /n Email address must be at least 7 characters long.");
    }
    
    
    
    else {
    document.signup.submit();
    }
    
    }
    
    
    
    </script>
     
  2. lumentec

    lumentec Thread Starter

    Joined:
    Mar 23, 2008
    Messages:
    103
    Solved. Supposed to be "else is" instead of "if else".
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Solved Javascript Help
  1. darshit
    Replies:
    1
    Views:
    435
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/754154

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice