how to use the error parameter of the jquery's $.ajax thing ? let's say i have a form, and then when I submit it, the data is being saved to the table using the PHP script used in the ,
$.ajax({
type: "POST",
url: "classes/ajax.submitcv.php",
data: "userid="+userid+"&resumetitle="+resumetitle+"&resumeintro="+resumeintro+
"&name="+name+"&dob="+dob+"&contacttel1="+contacttel1+"&contacttel1type="+contacttel1type+
"&contacttel2="+contacttel2+"&contacttel2type="+contacttel2type+"&contacttel3="+contacttel3+
"&contacttel3type="+contacttel3type+"&primaryemail="+primaryemail+"&secondaryemail="+secondaryemail+
"&skype="+skype+"&facebook="+facebook+"&linkedin="+linkedin+"&twitter="+twitter+
"&messenger="+messenger+"&yahoo="+yahoo+"&aol="+aol+"&summaryofpositionsought="+
summaryofpositionsought+"&summaryofskills="+summaryofskills+"&gender="+gender,
success: function(){
$('form#wsrecruitcvhead').fadeOut("normal",function(){
$('div.success').fadeIn(1000);
});
},
});
return false;
});
});
based from the code above, if the data went through the database table, the form disappears and the success message inside a tag shows, so how am I gonna output an error message instead, let's say I have a php function and the data to be inserted returns false, how to update the html file given the message and the form won't fadeOut ? in short..how to use the error param of $.ajax ?