Problem with beginner Javascript
<p>This code doesn't work, is there any visible reason?</p>

<p>the onClick is set as "doLogin();"</p>

<pre><code>function doLogin() 
{
    var url = "doLogin.php";
    var status = document.getElementById('statuslogin');
    status.innerHTML = "";
    var loginfield = document.getElementById('edtLogin');
    var passfield = document.getElementById('edtSenha');
    var chkremember = document.getElementById('chkRemeber');
    if (loginfield.value.length == 0 || passfiel.value.length == 0) {
        status.innerHTML = "Por favor, preencha o login e a senha.";
        return;
    } else if (loginfield.value.length &lt; 5) {
        status.innerHTML = "O login deve possuir pelo menos 5 caracteres.";
        return;
    } else {
    url = url+"?login="+loginfield.value+"&amp;senha="+passfield.value+"remeber="+chkremember.value;
    xmlHTTP.onreadystatechange=stateChanged;
    xmlHTTP.open("GET",url,true);
    xmlHTTP.send(null);
    }       
}

function stateChanged()
{
    if (xmlHTTP.readyState == 4) {
        var resposta = xmlHTTP.responseText;
        var status = document.getElementById('statuslogin');
        if (resposta == "Erro") {
            status.innerHTML = "Login ou senha incorretos! Tente novamente";
            return;
        }
        status.innerHTML = "Login efetuado. Aguarde redirecionamento.";
    }
}
</code></pre>
