I have a contact form that I am trying to reset automatically after is submitted. I have seen several posts for reseting or clearing forms here on SO.
I have tried several but I don't know exactly where to post the code.
This is what I have as the code:
$.ajax({
type: 'POST',
url: 'sendmessage.php',
data: $("#contact").serialize(),
success: function(data) {
if(data == "true") {
$("#contact").fadeOut("fast", function(){
$(this).before("<p> <strong>Success! Your request has been sent. We will respond to it as soon as possible. </strong></p>");
setTimeout("$.fancybox.close()", 3000);
I been trying to place
$("#contact")[0].reset();
But all of the places that I have tried to place that code it doesn't work...