-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
47 lines (46 loc) · 1.87 KB
/
index.html
File metadata and controls
47 lines (46 loc) · 1.87 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link href="img/style.css" rel="stylesheet" type="text/css">
<title>Subscribe us</title>
<script>
function check() {
var r = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
var email = document.getElementById('mail').value;
if (r.test (email) == false) {
var elem = document.getElementById('badmsg');
elem.style.display = "block";
elem = document.getElementById('goodmsg');
elem.style.display = "none";
} else {
var elem = document.getElementById('goodmsg');
elem.style.display = "block";
elem = document.getElementById('badmsg');
elem.style.display = "none";
}
return false;
}
</script>
</head>
<body>
<div align="center">
<div class="subscribe">
<div class="pad">
<h2>Subscribe to our newsletter.</h2>
<hr/>
Subscribe to our newsletter and get exclusive deals you want find anywhere else straight to your inbox!<br/><br/>
<div class="field">
<form name = "form1" action = "" method = "post" onsubmit = "return check();">
<input type = "text" id = "mail" name = "email" class = "emailtxt" placeholder="enter your e-mail address">
<input type = "submit" name = "someName" value = "subscribe" class="button">
</form>
</div>
<br/>
<div class="badmessage" id="badmsg">please enter a valid email address</div>
<div class="goodmessage" id="goodmsg">thanks, your address has been added</div>
</div>
</div>
</div>
</body>
</html>