-
Notifications
You must be signed in to change notification settings - Fork 0
/
Contact Us.html
104 lines (95 loc) · 3.51 KB
/
Contact Us.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
<!DOCTYPE html>
<html>
<head>
<title>Contact Us</title>
<link rel="stylesheet" href="Contact Us.css">
</head>
<body>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=1">
<title>Form Submit to Send Email</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<header>
<div class="banner">
<div class="banner-links">
<a href="main.html" class="banner-link">HeatMap</a>
<a href="iconic.html" class="banner-link">Incident Map</a>
</div>
<div class="banner-logo">
<a href="index.html"><img src="images/logo.png" alt="CrimeEye Logo"></a>
</div>
<div class="banner-links">
<a href="About Us.html" class="banner-link">About Us</a>
<a href="Contact Us.html" class="banner-link">Contact Us</a>
</div>
</div>
</header>
<form target="_blank" action="https://formsubmit.co/cfrielinghaus11@gmail.com" method="POST">
<label for="name">Name</label>
<input type="text" name="name" id="name" required>
<label for="email">Email</label>
<input type="email" name="email" id="email" required>
<input type="hidden" name="_next" value="http://127.0.0.1:5500/Thank%20You.html">
<label for="subject">Subject</label>
<input type="text" name="subject" id="subject" required>
<label for="message" name="message">Message</label>
<textarea name="message" id="message" required></textarea>
<br>
<button>Send</button>
</form>
<!--
<script>
const form = document.getElementById('contactForm');
form.addEventListener('submit', (event) => {
const nameInput = document.getElementById('name');
const emailInput = document.getElementById('email');
const messageInput = document.getElementById('message');
const name = nameInput.value.trim();
const email = emailInput.value.trim();
const message = messageInput.value.trim();
const errors = [];
// Validate the name field
if (name.length === 0) {
errors.push('Please enter your name');
document.getElementById('nameError').textContent = 'Please enter your name';
} else {
document.getElementById('nameError').textContent = '';
}
// Validate the email field
if (!email.includes('@')) {
errors.push('Please enter a valid email address');
document.getElementById('emailError').textContent = 'Please enter a valid email address';
} else {
document.getElementById('emailError').textContent = '';
}
// Validate the message field
if (message.length === 0) {
errors.push('Please enter a message');
document.getElementById('messageError').textContent = 'Please enter a message';
} else {
document.getElementById('messageError').textContent = '';
}
// If there are errors, prevent the form from being submitted
if (errors.length > 0) {
event.preventDefault(); // Prevent the default form submission behavior
const errorList = document.createElement('ul');
errors.forEach((error) => {
const li = document.createElement('li');
li.textContent = error;
errorList.appendChild(li);
});
const errorDiv = document.getElementById('errorDiv');
errorDiv.innerHTML = '';
errorDiv.appendChild(errorList);
} else {
window.location.href = 'Thank You.html';
}
});
</script> -->
</body>
</html>