-
Notifications
You must be signed in to change notification settings - Fork 0
/
form.html
297 lines (260 loc) · 8.14 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
<!DOCTYPE html>
<html>
<head>
<title>Set up Poll</title>
<link rel="icon" href="./images/icon.png" type="image/x-icon">
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css" rel="stylesheet" />
<style type="text/css">
@import url('https://fonts.googleapis.com/css?family=Lato&display=swap');
body {
background: linear-gradient(to right, #e91e63 0%, #e91e63 20%, #f44336 70%);
}
.form-style-10 {
width: 450px;
padding: 30px;
margin: 40px auto;
background: #FFF;
border-radius: 10px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.13);
-moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.13);
-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.13);
}
.form-style-10 .inner-wrap {
padding: 30px;
background: #F8F8F8;
border-radius: 6px;
margin-bottom: 15px;
}
.form-style-10 h1 {
background: #ff1a75;
padding: 20px 30px 15px 30px;
margin: -30px -30px 30px -30px;
border-radius: 10px 10px 0 0;
-webkit-border-radius: 10px 10px 0 0;
-moz-border-radius: 10px 10px 0 0;
color: #fff;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.12);
font: normal 30px 'lato', serif;
-moz-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
-webkit-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
border: 1px solid #99003d;
}
.form-style-10 h1>span {
display: block;
margin-top: 2px;
font: 13px Arial, Helvetica, sans-serif;
}
.form-style-10 label {
display: block;
font: 13px Arial, Helvetica, sans-serif;
color: #888;
margin-bottom: 15px;
}
.form-style-10 input[type="text"],
.form-style-10 input[type="date"],
.form-style-10 input[type="datetime"],
.form-style-10 input[type="email"],
.form-style-10 input[type="number"],
.form-style-10 input[type="search"],
.form-style-10 input[type="time"],
.form-style-10 input[type="url"],
.form-style-10 input[type="password"],
.form-style-10 textarea,
.form-style-10 select {
display: block;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
width: 100%;
padding: 8px;
border-radius: 6px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border: 2px solid #fff;
box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.33);
-moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.33);
-webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.33);
}
.form-style-10 .section {
font: normal 20px 'lato', serif;
color: #ff1a75;
margin-bottom: 5px;
}
.form-style-10 .section span {
background: #e91e63;
padding: 5px 10px 5px 10px;
position: absolute;
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border: 4px solid #fff;
font-size: 14px;
margin-left: -45px;
color: #fff;
margin-top: -3px;
}
.form-style-10 input[type="button"],
.form-style-10 input[type="submit"] {
background: #ff1a75;
padding: 8px 20px 8px 20px;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
color: #fff;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.12);
font: normal 30px 'lato', serif;
-moz-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
-webkit-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
border: 1px solid #99003d;
font-size: 15px;
}
.form-style-10 input[type="button"]:hover,
.form-style-10 input[type="submit"]:hover {
background: #99003d;
-moz-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.28);
-webkit-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.28);
box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.28);
}
.form-style-10 .privacy-policy {
float: right;
width: 250px;
font: 12px Arial, Helvetica, sans-serif;
color: #4D4D4D;
margin-top: 10px;
text-align: right;
}
h1 {
background: linear-gradient(to left, #e91e63 0%, #e91e63 20%, #f44336 70%) !important;
}
#submit_btn {
background: linear-gradient(to right, #e91e63 0%, #e91e63 20%, #f44336 70%) !important;
border: none !important;
padding: 10px 20px !important;
border-radius: 50px !important;
font-size: 16px !important;
border: 1px solid #e91e63 !important;
}
#submit_btn:hover {
background: white !important;
color: #e91e63 !important;
cursor: pointer;
}
* {
font-family: 'lato';
}
.form-style-10 #submit_btn {
position: relative !important;
left: 180px !important;
}
.input-file-container {
position: relative;
width: 150px;
}
.js .input-file-trigger {
display: block;
padding: 14px 10px;
background: #e91e63;
color: #fff;
font-size: 15px;
transition: all .4s;
cursor: pointer;
border: 1px solid white;
padding-left: 30px !important;
}
.js .input-file {
position: absolute;
top: 0;
left: 0;
width: 225px;
opacity: 0;
padding: 14px 0;
cursor: pointer;
}
.js .input-file:hover+.input-file-trigger,
.js .input-file:focus+.input-file-trigger,
.js .input-file-trigger:hover,
.js .input-file-trigger:focus {
background: #fff;
color: #e91e63;
border: 1px solid #e91e63;
}
</style>
</head>
<body>
<div class="form-style-10" >
<h1>Create your Voting Poll now!<span>Enter your details here</span></h1>
<form name="create-poll" data-netlify-recaptcha="true" data-netlify="true">
<div class="section"><span>1</span>Your organization details</div>
<div class="inner-wrap">
<label>Your Full Name <input type="text" name="field1" /></label>
<label>Your organization name <textarea name="field2"></textarea></label>
</div>
<div class="section"><span>2</span>Your Contact Info</div>
<div class="inner-wrap">
<label>Email Address <input type="email" name="field3" /></label>
<label>Phone Number <input type="text" name="field4" /></label>
</div>
<div class="section"><span>3</span>Personal Information</div>
<div class="inner-wrap">
<div class="input-file-container">
<input class="input-file" id="photo" type="file" name="field5">
<label tabindex="0" for="my-file" class="input-file-trigger">Select photo</label>
</div>
<label>About <textarea name="field6" id="about"></textarea></label>
<div data-netlify-recaptcha="true"></div>
</div>
<div class="button-section">
<input type="button" id="submit_btn" name="submit" value="Submit" onclick="validate()" />
</div>
</form>
</div>
<script type="text/javascript">
function validate() {
var x = document.form.field1.value;
var y = document.form.field2.value;
var z = document.form.field3.value;
var a = document.form.field4.value;
var f = document.querySelector('#photo');
var about = document.querySelector('#about').value;
var atpos = z.indexOf("@");
var dotpos = z.lastIndexOf(".");
if (x == null || x == "") {
alert('Name cannot be blank')
} else if (y == null || y == "") {
alert("Organization Name cannot be blank");
} else if (atpos < 1 || dotpos < atpos + 2 || dotpos + 2 >= z.length) {
alert("Please enter a valid email id");
} else if (a == "" || a.length < 10) {
alert("Please enter a 10 digit mobile number");
} else if(f.files.length == 0 ){
alert("No photo selected");
} else if(about == null || about == ""){
alert('About cannot be blank')
}
}
// file upload
document.querySelector("html").classList.add('js');
var fileInput = document.querySelector(".input-file"),
button = document.querySelector(".input-file-trigger"),
the_return = document.querySelector(".file-return");
button.addEventListener("keydown", function (event) {
if (event.keyCode == 13 || event.keyCode == 32) {
fileInput.focus();
}
});
button.addEventListener("click", function (event) {
fileInput.focus();
return false;
});
fileInput.addEventListener("change", function (event) {
the_return.innerHTML = this.value;
});
</script>
<script src="./scripts/jquery.js"></script>
</body>
</html>