-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontact.html
More file actions
86 lines (75 loc) · 3.05 KB
/
contact.html
File metadata and controls
86 lines (75 loc) · 3.05 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
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Contact — Nenzee.com</title>
<link rel="stylesheet" href="assets/css/main.css">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9429571484429929"
crossorigin="anonymous"></script>
</head>
<body>
<header class="container site-nav" role="banner">
<a class="skip-link" href="index.html">
<img src="images/NNZLogo.png" alt="Nenzee.com Home" height="40" width="40">
</a>
<nav class="nav-links" role="navigation" aria-label="Main navigation">
<a href="index.html">Home</a>
<a href="about.html">About</a>
<a href="contact.html">Contact</a>
</nav>
</header>
<main class="container">
<h1>Contact</h1>
<form id="contactForm" role="form" aria-label="contact-form">
<label for="comment-name">Name</label><br>
<input id="comment-name" name="name" required><br>
<label for="comment-email">Email</label><br>
<input id="comment-email" name="email" type="email" required><br>
<label for="comment-message">Message</label><br>
<textarea id="comment-message" name="comment" rows="5" required></textarea><br>
<!-- <label for="comment-clientnum">Client Number</label><br>
<input id="comment-clientnum" name="clientnum"><br>
-->
<button id="comment-submit" class="btn" type="submit">Send</button>
</form>
<footer class="site-footer" aria-label="Footer navigation">
<div1><a class="skip-link" href="index.html">© Nenzee — 2025</a>
</div1>
<div2><a class="skip-link" href="admin.html">Admin</a>
</div2>
</footer>
</main>
<script>
document.getElementById("contactForm").addEventListener("submit", async (e) => {
e.preventDefault();
const name=document.getElementById("comment-name").value;
const email=document.getElementById("comment-email").value;
const comment=document.getElementById("comment-message").value;
// const clientnum=document.getElementById("comment-clientnum").value;
try {
const response=await fetch("http://localhost:3001/api/comment", {
method:"POST",
headers:{"Content-Type":"application/json"},
body:JSON.stringify({name,email,comment,clientnum})
});
const result=await response.json();
alert(result.message || result.error);
document.getElementById("contactForm").reset();
} catch(err) {
alert("Error connecting to server.");
console.error(err);
}
});
</script>
<!-- Azure Cosmos/Firebase (commented for future use)
<script type="module">
// import { initializeApp } from "https://www.gstatic.com/firebasejs/10.13.2/firebase-app.js";
// import { getFirestore } from "https://www.gstatic.com/firebasejs/10.13.2/firebase-firestore.js";
// const firebaseConfig = { ... };
// const app = initializeApp(firebaseConfig);
// const db = getFirestore(app);
</script>
-->
</body>
</html>