I'm a rookie scripter and what I'm trying to do is: create a registration form and a calculator. If you enter a password less than 5 symbols or a username less than 3 symbols you will not be able to continue. But even if I enter an username with more than 3 symbols and a password with more than 5 symbols it still displays the error message.

The code: <http://pastebin.com/KqYbDJMw>

```
var user = document.forms[0].username.value;
var pw = document.forms[0].password.value;

function triggerCalc(){
    if (pw.length < 5 && user.length < 3){
        alert("An error occured");
    }
    else  {
        alert("Thank you for registering to my website.");
        var action = prompt("Welcome to my calculator. For addition press 1, for substraction press 2, for multiplication press 3, for division press 4 and for square root press 5:", "");

        var firstNum = new Array();
        var secondNum = new Array();
        var result = new Array();

```