-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.html
53 lines (50 loc) · 2.05 KB
/
contact.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="contact.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
function confirmSend() {
alert("Your message has been sent. Thank you for contacting me.");
}
function validateForm() {
var name = document.getElementById("name").value;
var email = document.getElementById("email").value;
var phone = document.getElementById("phone").value;
var message = document.getElementById("message").value;
if (name == "" || email == "" || phone == "" || message == "") {
alert("Please fill out all the fields.");
return false;
}
else {
confirmSend()
}
}
</script>
</head>
<body>
<main id="0">
<h1>Contact Me</h1>
<p>If you have any questions or feedback, please fill out the form below and I will get back to you as soon as
possible.</p>
<form action="mailto:[email protected]" method="post" enctype="text/plain"
onsubmit="return validateForm()">
<label for="name">Name.</label>
<input type="text" id="name" name="name" required>
<label for="email">Email.</label>
<input type="email" id="email" name="email" required>
<label for="phone">Phone.</label>
<input type="tel" id="phone" name="phone" pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}" placeholder="123-456-7890">
<label for="message">Message.</label>
<textarea id="message" name="message" rows="10" cols="40" required></textarea>
<div class="btn-cont">
<input type="submit" value="Send">
<input type="reset" value="Reset">
</div>
</form>
</main>
</body>
</html>