-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
133 lines (85 loc) · 3.93 KB
/
index.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Sign Up</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<link rel="stylesheet" href="css/my.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign Up Form</title>
<link rel="stylesheet" href="css/normalize.css">
<link href='https://fonts.googleapis.com/css?family=Nunito:400,300' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/main.css">
<style type="text/css">
</style>
</head>
<body>
<form action="php/registe.php" method="post" id="form" name="registration">
<h1>Sign Up</h1>
<fieldset>
<legend>你的基础信息</legend>
<label for="name">名字:</label>
<input type="text" id="name" name="user_name" placeholder="zhangsan" required>
<label for="mail">Email:</label>
<input type="email" id="mail" name="user_email" placeholder="[email protected]" onkeyup="ValidateEmail(); return false;" required>
<label for="password">密码:</label>
<input type="password" id="password" name="user_password" placeholder="●●●●●" required>
<label for="confirm_password">再次输入密码:</label>
<input type="password" id="confirm_password" name="confirm_password" onkeyup="checkPass(); return false;" placeholder="●●●●●" required>
<span class="confirmMessage" id="confirmMessage"></span>
<label for="mobile">电话:</label>
<input type="mobile" id="mobile" name="user_mobile" required>
<label for="age">年龄</label>
<input type="number" id="age" name="user_age" required>
<label>性别</label>
<input type="radio" id="under_13" value="男" name="user_gender"><label for="under_13" class="light">男</label><br>
<input type="radio" id="over_13" value="女" name="user_gender"><label for="over_13" class="light">女</label>
</fieldset>
<button type="submit">注册</button>
</form>
<!-- value="submit" name="submit" -->
<!-- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$("#btnSubmit").click(function () {
var password = $("#password").val();
var confirmPassword = $("#confirm_password").val();
if (password != confirmPassword) {
alert("Passwords do not match.");
return false;
}
return true;
});
});
</script> this script is regarding appearing dialog box -->
<script type="text/javascript">
function checkPass(){
var password = document.getElementById("password");
var confirmPassword= document.getElementById("confirm_password");
var message = document.getElementById("confirmMessage");
var goodColor = "#66cc66";
var badColor = "#ff6666";
if(password.value == confirmPassword.value)
{
confirmPassword.style.backgroundColor = goodColor;
message.innerHTML = "密码输入成功!"
}
else{
confirmPassword.style.backgroundColor = badColor;
message.style.color = badColor;
messase.innerHTML= "密码错误"
}
function ValidateEmail(mail)
{
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail))
{
return (true)
}
alert("您输入了一个无效的电子邮件地址!")
return (false)
}
}
</script>
</body>
</html>