-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
54 lines (39 loc) · 1.34 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
$("#submit-form").submit((e)=>{
e.preventDefault();
const formData = $("#submit-form").serialize();
$.ajax({
url:"https://script.google.com/macros/s/AKfycbyIfSar_6lacB707KiFxBNZYxorxCpc08RLtqK6rhRTtjmRxVmhNd4VPCv5anMwxxF7/exec",
data:formData,
method:"post",
success:function (response){
alert("Form submitted successfully");
window.location.reload();
//window.location.href="https://google.com"
},
error:function (err){
alert("Something Error");
},
});
});
function toggleMenu() {
const menu = document.querySelector(".menu-links");
const icon = document.querySelector(".hamburger-icon");
menu.classList.toggle("open");
icon.classList.toggle("open");
}
// Example starter JavaScript for disabling form submissions if there are invalid fields
(() => {
'use strict'
// Fetch all the forms we want to apply custom Bootstrap validation styles to
const forms = document.querySelectorAll('.needs-validation')
// Loop over them and prevent submission
Array.from(forms).forEach(form => {
form.addEventListener('submit', event => {
if (!form.checkValidity()) {
event.preventDefault()
event.stopPropagation()
}
form.classList.add('was-validated')
}, false)
})
})()