-
Notifications
You must be signed in to change notification settings - Fork 6
/
submit.html
86 lines (80 loc) · 2.88 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
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>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>XCJ sign-up page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<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>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/bouncer.css">
</head>
<body onload="document.getElementById('email').focus();">
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1>Xinchejian Sign-up Page 加入新车间会员</h1>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="well">
<form action="submit.php" method="POST" onsubmit="return validateForm();">
<div class="form-group">
<label for="email">E-mail | 邮件地址</label>
<input id="email" type="email" class="form-control" name="email" required />
</div>
<div class="form-group">
<label for="amount">Amount paid in cash | 会员费</label>
<select name="amount" id="amount" class="form-control">
<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>
<option value="900">900 RMB = 12 months 12个月</option>
<option value="5000">5000 RMB = 12 months sponsor 12个月赞助人</option>
</select>
</div>
<div class="form-group" align="right">
<input type="submit" id="submit" class="btn btn-success" value="Submit|提交"/>
</div>
</form>
</div>
</div>
</div>
</div>
<span id="forkongithub"><a href="https://github.com/xinchejian/bouncer">Fork me on GitHub</a></span>
<script src="js/jquery-1.11.3.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>