Browse Source

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 8 months ago
parent
commit
56acd7765b
  1. 9
      themes/openpowerfoundation/assets/js/form.js

9
themes/openpowerfoundation/assets/js/form.js

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

Loading…
Cancel
Save