changes to form script

* reset form after submission
* don't use goal if not set
* show sendmessage and fade after 2500ms

Signed-off-by: Toshaan Bharvani <toshaan@vantosh.com>
master
Toshaan Bharvani 3 years ago
parent fa187dffa6
commit 56acd7765b

@ -85,10 +85,15 @@ jQuery(document).ready(function($) {
complete: function() { complete: function() {
$("#sendmessage").addClass("show"); $("#sendmessage").addClass("show");
$("#errormessage").removeClass("show"); $("#errormessage").removeClass("show");
$('.contactForm').find("input, textarea").val(""); $(formname)[0].reset();
if(goal) { $('input[type="text"],textarea').val('');
if(typeof goal !== 'undefined') {
_paq.push(['trackGoal', goal]); _paq.push(['trackGoal', goal]);
} }
$('#sendmessage').show();
setTimeout(function() {
$('#sendmessage').fadeOut();
}, 2500);
} }
}); });
return false; return false;

Loading…
Cancel
Save