-
Notifications
You must be signed in to change notification settings - Fork 0
/
mail.html
83 lines (74 loc) · 1.65 KB
/
mail.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
<!DOCTYPE html>
<html>
<head>
<style>
* {
font-family: Arial, sans-serif;
}
form {
display: flex;
flex-direction: column;
align-items: center;
width: 50%;
margin: 0 auto;
}
@media (max-width: 600px) {
form {
width: 100%;
}
}
label {
margin-bottom: 10px;
color: #333;
}
input[type="email"] {
width: 100%;
padding: 12px 20px;
margin-bottom: 10px;
box-sizing: border-box;
border: 2px solid #333;
border-radius: 4px;
color: #333;
}
input[type="submit"] {
width: 100%;
background-color: #333;
color: white;
padding: 14px 20px;
margin-bottom: 10px;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #444;
}
.error {
color: red;
font-size: 0.8em;
margin-top: 10px;
}
</style>
</head>
<body>
<form onsubmit="return validateForm()" action="send-email.php" method="post">
<label for="email">Enter your email address to join the mailing list:</label><br>
<input type="email" id="email" name="email"><br>
<input type="submit" value="Join mailing list">
<div id="error" class="error"></div>
</form>
<script>
function validateForm() {
var email = document.getElementById("email").value;
var error = document.getElementById("error");
if (email == "") {
error.textContent = "Please enter your email address.";
return false;
} else {
error.textContent = "";
return true;
}
}
</script>
</body>
</html>