Last active
November 7, 2019 04:18
-
-
Save karimmakhloufi/ee2d15c613eefd150e21daaaa23aac8a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form id="leadForm" action="https://script.google.com/macros/s/AKfycbyd9b-t6PKBKZPrtKTNhG9fNUWHmPGjVg4VnhWIrKundTFlZLI/exec"> | |
<input type="email" name="email" placeholder="Your email address"> | |
<input type="submit" id="LeadFormSubmit"> | |
</form> | |
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
var $form = $('#leadForm'); | |
var $subm = $('#LeadFormSubmit'); | |
var $impt = $form.find(':input').not(':button, :submit, :reset, :hidden'); | |
$form.submit(function(){ | |
$.post($(this).attr('action'), $(this).serialize(), function(response){ | |
$impt.val('').attr('value','').removeAttr('checked').removeAttr('selected'); | |
$subm.prop('disabled', true); | |
},'json'); | |
return false; | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment