Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
185
rated 0 times [  187] [ 2]  / answers: 1 / hits: 59947  / 14 Years ago, sun, august 15, 2010, 12:00:00

I'm displaying a message (#final_msg) after the user submits the form. What I want to do is that, after 15 seconds, the message (#final_msg) should fade out, clearing away [or fading out] the text in the input elements as well. Is it possible to do this?



else {
//create post data
var postData = {
name : $(#name).val(),
email : $(#email).val(),
msg : $(#msg).val(),
origin : $(#origin).val()
};

//make the call
$.ajax({
type: POST,
url: test.php,
data: postData, //send it along with your call
success: function(response){
$('#final_msg').fadeIn();

}
});
}

More From » jquery

 Answers
11
setTimeout(function() {
$('#final_msg').fadeOut();
$('#name, #email, #msg, #origin').val('')
}, 10000 );

[#95915] Thursday, August 12, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dannyc

Total Points: 517
Total Questions: 106
Total Answers: 116

Location: Netherlands
Member since Mon, Jun 7, 2021
3 Years ago
;