-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathindex.html
More file actions
61 lines (56 loc) · 2.29 KB
/
index.html
File metadata and controls
61 lines (56 loc) · 2.29 KB
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
<!DOCTYPE html>
<html lang = "en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Headstorm </title>
<link rel="icon" type="image/x-icon" href="/images/favicon.ico" />
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<h1> Headstorm </h1>
<h2> Contact Us</h2>
<form id = "contact">
<label for = "fname"> First Name</label><br>
<input type = "text" id = "fname" name = "fname" /><br>
<label for = "lname"> Last Name</label><br>
<input type = "text" id = "lname" name = "lname" /><br>
<label for = "email"> Email</label><br>
<input type = "text" id = "email" name = "email" /><br>
<label for = "number"> Number</label><br>
<input type = "text" id = "number" name = "number"/><br>
<button class="g-recaptcha"
data-sitekey="6LfuT8QeAAAAAF79Xo1I-6Rjvzozrg0dUua0T-ph"
data-callback="onSubmit"> Submit </button>
</form>
<script>
var recaptcha = "";
function submitContactInfo() {
if(recaptcha.length == 0) {
console.log("Recaptcha verification unsuccessful");
}
var fname = document.getElementById("fname").value;
var lname = document.getElementById("lname").value;
var email = document.getElementById("email").value;
var number = document.getElementById("number").value;
if (fname.length == 0) {
console.log("First name is left blank");
}
if (lname.length == 0) {
console.log("Last name is left blank");
}
if (email.length == 0 || email.indexOf("@") == -1) {
console.log("Enter valid email");
}
if (number.length != 10) {
console.log("Enter valid phone number")
}
}
function onSubmit(token) {
recaptcha = token;
submitContactInfo();
}
</script>
</body>
</html>