this is probably very simple for a jQuery expert.
I have <div id = "form23"> <form <textarea> blahblah </textarea> <input type = "button" value = "save" OnClick = "saveCaption (23)"> </ form> </DIV>
I want the SAVED message to appear and disappear. But I do NOT want the form or its elements to disappear.
I have an AJAX call that looks like this.
function saveCaption(id) {
var queryString = $('#form'+id).formSerialize();
$.ajax({
type: "POST",
url: "includes/ajax.php?request=saveCaption",
data: queryString,
success: function(response) {
$('#form'+id).append(response)
}
});
return false;
}
I was wondering ... I can add an answer. But is there a way to disappear right after the second. Right now, he just keeps repeating and adding to the last addition. I would like it to appear and disappear immediately after using fadeOut.
: IV RaYell. ... ?
saveCaption (id) {
var queryString = $('#form'+id).formSerialize();
$.ajax({
type: "POST",
url: "includes/ajax.php?request=saveCaption",
data: queryString,
success: function(response) {
$('#form'+id).append('<div id="message">'+response+'</div>');
setTimeout(function () {
$('#message').fadeOut(function(){
$(this).remove();
});
}, 1000);
}
});
return false;
}