-
Notifications
You must be signed in to change notification settings - Fork 0
/
form.html
125 lines (91 loc) · 2.15 KB
/
form.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Registration | Form</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="all,follow">
<style>
*{
box-sizing: border-box;
padding: 0;
margin: 0;
font-family: 'poppins', sans-serif;
font-size: 18px;
}
body{
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.container{
width: 500px;
padding: 30px;
border: 1px solid #eeeeee;
border-radius: 10px;
background-color: #003b5b;
color: white;
}
h4{
margin-bottom: 10px;
font-size: 24px;
color: white;
}
input{
width: 100%;
padding: 10px;
margin-bottom: 10px;
}
textarea{
width: 100%;
padding: 10px;
}
#submit{
border: none;
background-color: orangered;
color: white;
width: 200px;
margin-top: 10px;
border-radius: 5px;
}
#submit:hover{
background-color: green;
}
</style>
<!-- <link rel="stylesheet" href="Google Sheet.css"> -->
</head>
<body>
<div class="container">
<form method="post" id="sheetdb-form" action="https://sheetdb.io/api/v1/vgbvme3cgb2jt" name="contact-form">
<h4>Contact Us</h4>
<input type="text" name="name" placeholder="Name">
<input type="text" name="number" placeholder="Number">
<input type="email" name="email" placeholder="Email">
<textarea name="message" rows="7" placeholder="Your Message"></textarea>
<input type="submit" value="Submit" id="submit">
</form>
</div>
<iframe src="https://sheetsu.com/a/f/010ea6e59bf9?embedded=true"
width="100%" height="600" frameBorder="0"
style="background: transparent; border: 1px solid #dedede;"></iframe>
<script>
var form = document.getElementById('sheetdb-form');
form.addEventListener("submit", e => {
e.preventDefault();
fetch(form.action, {
method : "POST",
body: new FormData(document.getElementById("sheetdb-form")),
}).then(
response => response. .json()
).then((html) => {
// you can put any JS code here
windows.open('new.html', '_blank');
});
});
</script>
<script src="Google Sheet.js"></script>
</body>
</html>