2
I have a simple form to login users with login and password... I’m not getting to give Submit via Jquery, look at the code:
<div id="opcoes2">
<div id="fazerlogin2">
<form name="fazerloginform" id="fazerloginform" action="fazerloginform.php" method="post">
<input id="login" type="text" name="login" value="Login ou email">
<input id="senha" type="password" name="senha" value="Senha">
<span id="esqueceusenha">Esqueceu a senha ?</span>
<input id="entrar" type="submit" value="ENTRAR">
<div id="loginresposta"></div>
</form>
</div>
<script>  
$(document).ready(function() {
        $("#fazerloginform").submit(function() {
            var login = $("#login").val();
            var senha = $("#senha").val();
            $("#entrar").prop('disabled', true);
            $("#loginresposta").html("Logando...");
            $.post('fazerloginform.php', {
                login: login,
                senha: senha
            }, function(resposta) {
                if (resposta != false) {
                    $("#fazerloginform").submit();
                } else {
                    $("#loginresposta").html("Login ou senha incorretos.");
                    $("#entrar").prop('disabled', false);
                }
            }, 'html');
            return false;
        });
 })
</script>  
I’m using jquery version 2.1.1.js, is that it? The error that gives is that it is "Logging..." and for the script, it does not give the Submit!!!
I also wanted to know the best way to login in php and mysql with jquery ?