forked from xinchejian/bouncer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubmit.html
59 lines (59 loc) · 2.07 KB
/
submit.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
54
55
56
57
58
59
<!DOCTYPE html>
<html>
<head>
<title>XCJ sign-up page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name='viewport' content='width=320'/>
<script type="text/javascript" language="javascript"><!--
function validateEmail(str) {
// atext=[a-zA-Z0-9!#$%&*+\-\/=?^_`{\|}~]
var emailRegEx = /^[a-zA-Z0-9+\-_]+(\.[a-zA-Z0-9+\-_]+)*@[a-zA-Z0-9+\-_]+(\.[a-zA-Z0-9+\-_]+)*\.[a-zA-Z]{2,6}$/;
return emailRegEx.test(str);
}
function validateForm() {
// check email address
var str = document.getElementById('email').value;
if (!validateEmail(str)) {
alert('Please enter a valid email address.');
document.getElementById('email').focus();
return false;
}
str = document.getElementById('amount').value;
if (str == '0') {
alert('Please pick a valid amount.');
document.getElementById('amount').focus();
return false;
}
// success
document.getElementById('submit').disabled = true;
setTimeout(enableSubmit, 5000);
return true;
}
function enableSubmit() {
document.getElementById('submit').disabled = false;
}
//-->
</script>
<link rel="stylesheet" type="text/css" href="bouncer.css">
</head>
<body onload="document.getElementById('email').focus();">
<h1>加入新车间会员</h1>
<h1>Xinchejian Sign-up Page</h1>
<form action="submit.php" method="POST" onsubmit="return validateForm();">
<p>E-mail | 邮件地址<br/>
<input id="email" type="email" name="email" required />
</p>
<p>Amount paid in cash | 会员费<br/>
<select name="amount" id="amount">
<option value="0">-- Pick membership period | 选择会员时间 --</option>
<option value="100">100 RMB = 1 month 1个月</option>
<option value="450">450 RMB = 6 months 6个月</option>
</select>
</p>
<p>
<input type="submit" id="submit" value="Submit|提交"/>
</p>
</form>
<span id="forkongithub"><a href="https://github.com/xinchejian/bouncer">Fork me on GitHub</a></span>
</body>
</html>