forked from ZeroDeath2/TinkHack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
datacollection.html
59 lines (54 loc) · 2.89 KB
/
datacollection.html
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
55
56
57
58
59
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" >
<link rel="stylesheet" href="./stl_data.css">
<title>I am ready to help</title>
</head>
<body>
<div class="container py-5">
<div class="row">
<div class="box">
<div class="col-lg-5 col-md-8 mx-auto shadow-lg p-3 mb-5 bg-white rounded border bg-white p-5 rounded">
<h2 class="text-center fw-bold mb-3">Contact Us</h2>
<form id="google-sheet">
<div class="div" id="form_alerts"></div>
<div class="form-group mb-3">
<label for="name" class="form-label">Name</label>
<input type="text" id="name" name="name" class="form-control" placeholder="Enter your name" required>
</div>
<div class="form-group mb-3">
<label for="email" class="form-label">Email</label>
<input type="email" id="email" name="email" class="form-control" placeholder="Enter your Email" required>
</div>
<div class="form-group mb-3">
<label for="message" class="form-label">Message</label>
<textarea type="message" id="message" name="message" class="form-control" placeholder="Enter the message" rows="5" required></textarea>
</div>
<div>
<button class="btn btn-success me-2" type="submit">Help Me</button>
<button class="btn btn-danger" type="reset">Reset form</button>
</div>
</form>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" ></script>
<script>
const scriptURL = 'https://script.google.com/macros/s/AKfycbzXfn6MEhBVDrJMbrLIfUco5zftEnSJ3XhhGD6Yh-n6w-15Kw7cYwPx9KXC_IWAOpN-/exec'
const form = document.forms['google-sheet']
form.addEventListener('submit', e => {
e.preventDefault()
fetch(scriptURL, { method: 'POST', body: new FormData(form)})
.then(response => $("#form_alerts").html("<div class='alert alert-success'>Message sent Successfully. We'll be reaching you soon... </div>"))
.catch(error => $("#form_alerts").html("<div class='alert alert-danger'>Message not sent. We are currently facing some issues...</div>"))
})
</script>
<img src="" alt="">
</body>
</html>