The title almost says it all. I have a jquery code i’ve written, im not good at it but this is what i achieved:
$("#myForm").submit(function(){
//alert($(this).serialize());
$.post("submit.php", $(this).serialize(), function(data){
if(data == success) {
$("#add_vote").fadeOut("fast");
$("#verification_sent").fadeIn("fast");
$("#wrong").fadeOut("fast");
} else {
$("#wrong").fadeIn("fast");
}
});
return false;
});
The form gets submitted well but the fadeIn and fadeOut’s I have does not work. Do anyone know why?
What is
successin:Maybe you mean:
Or else you maybe have misunderstood the
$.postfunction?Lets break it up:
And its only a helper function for the
$.ajaxmethod, Witch also have a error callback: