-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact-form.html
45 lines (37 loc) · 1.38 KB
/
contact-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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contact Form Using JavaScript</title>
<link rel="stylesheet" href="css/contact-form.css">
</head>
<body>
<div class="container">
<form onsubmit="openPopup(); reset(); return false;">
<h3>GET IN TOUCH</h3>
<input type="text id=name" placeholder="Your Name" required>
<input type="email id=email" placeholder="Email Id" required>
<input type="text id=phone" placeholder="Phone Number" required>
<input type="text id=name" placeholder="Topic" required>
<textarea id="message" rows="4" placeholder="How can we help you?"></textarea>
<button type="submit" class="btn" onclick="openPopup()" >Send</button>
</form>
</div>
<!-- adding popup message confirmation in form -->
<div class="popup" id="popup">
<img src="img/tick.png">
<h2>Thank You</h2>
<p>Your details has been successfully submitted. Thanks</p>
<a href="index.html"><button type="button" onclick="closePopup()">OK</button></a>
</div>
<script>
let popup = document.getElementById("popup");
function openPopup(){
popup.classList.add("open-popup")
}
function closePopup(){
popup.classList.remove("open-popup")
}
</script>
</body>
</html>