I have a js and html form that submits through php. Once submitted, the email is sent and php returns a success message that is appended to the bottom of the form using jquery.
submitHandler: function(form) {
$.ajax({
type: 'POST',
url: 'process.php',
data: $(this).serialize(),
success: function(returnedData) {
$('#commentForm').append(returnedData);
}
});
return false;
},
Instead, I want the js to remove and reset (hide and clear) the comment form but still append the returned data to the same location as #commentForm
The remove() function does that.