2
Well, a simple ajax, php and mysql query. This same code changed only by field name works normally on another page.
$(document).ready(function(){
$('#email').keyup(function(){
var Email = $(this).val();
var EmailResult = $('#div_mensagem_valida_email');
if(Email.length > 3) {
EmailResult.html('Verificando..');
var UrlToPass = 'action=email='+Email;
$.ajax({
type : 'POST',
data : UrlToPass,
url : 'include/cadastra_novo_cliente_verifica.php',
success: function(responseText){
if(responseText == 1){
EmailResult.html('<span class="error">Ops, este e-mail já está cadastrado</span>');
}
else(responseText == 0){
EmailResult.html('');
}
}
});
}else{
EmailResult.html('Aguardando...');
}
if(Email.length == 0) {
EmailResult.html('');
}
});
$('#email').keydown(function(e) {
if (e.which == 32) {
return false;
}
});
});
The input is:
<input id="email" class="form-control input-lg" type="text" name="email" autocomplete="off" placeholder="Seu e-mail" required>
Just nothing happens, no Firebug returns me error
But in the Network tab (network) shows the request for the page
include/cadastra_novo_cliente_verifica.php
? In the console tab shows some syntax error of the front-end (javascript)?– Guilherme Nascimento
var UrlToPass = 'action=email='+Email
. What’s this? Action = Email = Email– Diego Souza
@Guilhermenascimento, does not show, in the console appears only 'Syntaxerror: Missing ; before statement'
– sNniffer
That is your problem
SyntaxError: missing ; before statement'
there is a syntax error in your javascript that will affect the functioning and nothing will run, remember syntax errors prevent the rest of the script they see from working... This error message says that a;
somewhere– Guilherme Nascimento