-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
31 lines (29 loc) · 922 Bytes
/
script.js
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
//converts topnav into mobile mode
function mobile_menu() {
var x = document.getElementById("topnav");
if (x.className === "nav") {
x.className += " mobile";
} else {
x.className = "nav";
}
}
// send function sends email from email contact form
function send() {
// if statement doesn't send email if any text boxes are invalid
if (
document.getElementById("name").checkValidity() &&
document.getElementById("email").checkValidity() &&
document.getElementById("message").checkValidity()
) {
var params = {
name: document.getElementById("name").value,
email: document.getElementById("email").value,
message: document.getElementById("message").value
}
// NOTE: fake sender emails will still send message followed by auto message error reply
emailjs.send("service_ml39rlg", "template_qmvvvfp", params);
alert("Email sent!");
}
else
alert("Please fill in all text boxes properly.");
}