Salve.
Ho questo codice che per qualche strano motivo non funziona....
codice:
<script src="jquery.js" type="text/javascript" language="javascript"></script>
<script language="javascript">
$(document).ready(function()
{
$("#signup_form").submit(function()
{
$("#msgbox").removeClass().addClass("messagebox").text("Controllo....").fadeIn(2000);
$.post("core/iscrizione.php",{ username:$("#username").val(),password:$("#password").val(),email:$("#email").val(),stato:$("#stato").val(),referer:$("#referer").val(),nome:$("#nome").val(),citta:$("#citta").val(),azione:$("#azione").val(),rand:Math.random() } ,function(data)
{
if(data=="si") //if correct login detail
{
$("#msgbox").fadeTo(200,0.1,function()
{
$(this).html("Registrato correttamente! Attiva l'account seguendo le istruzioni nella mail che ti abbiamo inviato.").addClass("messageboxok").fadeTo(1000,1);
});
}
else if(data=="username")
{
$("#msgbox").fadeTo(200,0.1,function()
{
$(this).html("C'è un errore nell'username. Controlla.").addClass("messageboxerror").fadeTo(1000);
}
else if(data=="username1")
{
$("#msgbox").fadeTo(200,0.1,function()
{
$(this).html("Username gia' utilizzato.").addClass("messageboxerror").fadeTo(1000);
}
else if(data=="username2")
{
$("#msgbox").fadeTo(200,0.1,function()
{
$(this).html("Campo username obbligatorio.").addClass("messageboxerror").fadeTo(1000);
}
else if(data=="username3")
{
$("#msgbox").fadeTo(200,0.1,function()
{
$(this).html("Username inserito troppo lungo.").addClass("messageboxerror").fadeTo(1000);
}
else if(data=="email1")
{
$("#msgbox").fadeTo(200,0.1,function()
{
$(this).html("Indirizzo email non valido.").addClass("messageboxerror").fadeTo(1000);
}
else if(data=="email2")
{
$("#msgbox").fadeTo(200,0.1,function()
{
$(this).html("Indirizzo email troppo lungo.").addClass("messageboxerror").fadeTo(1000);
}
else if(data=="email3")
{
$("#msgbox").fadeTo(200,0.1,function()
{
$(this).html("Il campo email e' obbligatorio.").addClass("messageboxerror").fadeTo(1000);
}
else if(data=="password1")
{
$("#msgbox").fadeTo(200,0.1,function()
{
$(this).html("Il campo password e' obbligatorio.").addClass("messageboxerror").fadeTo(1000);
}
else if(data=="password2")
{
$("#msgbox").fadeTo(200,0.1,function()
{
$(this).html("Password inserita troppo lunga.").addClass("messageboxerror").fadeTo(1000);
}
else if(data=="stato1")
{
$("#msgbox").fadeTo(200,0.1,function()
{
$(this).html("Il campo stato e' obbligatorio.").addClass("messageboxerror").fadeTo(1000);
}
else if(data=="citta1")
{
$("#msgbox").fadeTo(200,0.1,function()
{
$(this).html("Il capo citta' e' obbligatorio.").addClass("messageboxerror").fadeTo(1000);
}
else
{
$("#msgbox").fadeTo(200,0.1,function()
{
$(this).html("Dati errati.").addClass("messageboxerror").fadeTo(1000,1);
});
}
});
return false;
});
$("#password").blur(function()
{
$("#signup_form").trigger("submit");
});
});
</script>
Sapete darmi una spiegazione?
Il file php a cui è collegato elabora correttamente.
Ma Non compare nessuno dei messaggi.
Notate qualche errore?
Grazie