我让它变得简单:
我现在使用谷歌表单作为我的数据库。
在我为提交按钮添加重置功能后,它再次将 JS 文件发送到谷歌表单的响应页面。
你能帮我吗 ?谢谢
<form id="form" action="https://docs.google.com/forms/u/2/d/e/1FAIpQLSeBJHw1Q6YlwO_0s2OgMhuyQEj4PLvToM1N1G5BEYQRiZlCLQ/formResponse">
<label for="">It's FREE</label>
<input type="text" placeholder="Full Name" class="inputs" id="input1" name="entry.1045366435">
<input type="email" placeholder="Email" class="inputs" id="input2" name="entry.1398681060">
<textarea cols="30" rows="10" placeholder="Message" id="input3" name="entry.403219718"></textarea>
<input type="submit" id="submit" value="Send">
</form>
$('#form').submit(function(e) {
alert("Thanks for signing up. We will contact you as soon as we can.");
e.preventDefault();
$.ajax({
url: "https://docs.google.com/forms/u/2/d/e/1FAIpQLSeBJHw1Q6YlwO_0s2OgMhuyQEj4PLvToM1N1G5BEYQRiZlCLQ/formResponse",
data: $(this).serialize(),
type: "POST",
success: function(data) {
$('#form')[0].reset()
},
dataType: "xml",
success: function(data) {
console.log('Submission successful');
},
error: function(xhr, status, error) {
console.log('Submission failed: ' + error);
}
});
});
//Alert + Disable google form response page
胡说叔叔
慕的地6264312
相关分类