I have a form that fills in a codeigniter calender. First off I will say the form works just fine with Ajax & my controller. The first time I submit the form all data goes to the database and I get my success event which is just repeating what I entered, then it fades out. Works great.
The second time I enter data(I usually enter data into the database at least 5-6 times in succession) the data goes to the database but no second event message. Or 3rd, 4th etc.
My question is how do I make the success callback fire each time I submit the form?
My jquery
$(function() {
$('.error').hide();
$("#calen").submit(function() {
var data = $('#calen').serialize();
$.ajax({
url: ("http://XXXXXX.net/mycal/cale"),
data: data,
type: "POST",
success: function(msg){
$('#cal').append(msg);
$('#cal').delay(5000).fadeOut(1500);
}
});
return false;
});
});
I know this has to be simple. Thank you for your time
It looks like the problem is that you fadeOut, but never fade back in. Try adding :
right before you append the message to the element.