-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
94 lines (90 loc) · 4.42 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
<!Doctype html>
<html>
<head>
<title>用户注册-demo</title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link href="css/styles.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
<div id="login" class="page active">
<div class="main">
<div class="tab">
<div class="tab-content">
<div class="tab-pane active">
<form class="form" id="form1" method="post" action="/">
<div class="form-control">
<input id="phone" type="text" placeholder="请输入邮箱/手机号" check="required xishiqu_account" />
<div class="message">请输入邮箱/手机号</div>
</div>
<div class="form-control">
<input id="phone2" type="text" placeholder="请输入手机号" check="required mobile ajaxvalid" ajaxurl="http://www.cakeland.com/json.ashx?C=User&m=checkPhone" />
<div class="message">请输入手机号</div>
<span class="btn send-code">获取验证码</span>
</div>
<div class="form-control">
<input id="email" type="text" placeholder="请输入邮箱" check="required email" />
<div class="message">请输入手机号</div>
</div>
<div class="form-control">
<input id="num" type="text" placeholder="请输入数量" check="required num" />
<div class="message">请输入手机号</div>
</div>
<div class="form-control">
<input id="password1" type="password" placeholder="请输入密码" check="required pwd1 length" min="6" max="12" />
<div class="message">请输入密码</div>
</div>
<div class="form-control">
<input id="password2" type="password" placeholder="请输入确认密码" check="required pwd2" />
<div class="message">请输入密码</div>
</div>
<input type="submit" class="btn btn-primary btn-block" value="注册" />
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="js/lib/zepto.min.js"></script>
<script src="js/validate-form.js"></script>
<script src="js/sms.js"></script>
<script type="text/javascript">
$(function () {
var validateParams = {
onChange: function (isValid, $elem, msg) {
if (isValid) {
$elem.next().removeClass("error");
} else {
$elem.focus().next().text(msg).addClass("error");
}
}
};
$("#form1").on("submit", function () {
var isValid = $(this).ValidateForm(validateParams);
if (!isValid) {
return false;
}
console.log("ok!");
return false;
});
$('.send-code').sms({
mobile: $('#phone2'),
validate: function ($ele) {
var valid = $ele.ValidateForm(validateParams);
return valid;
}
});
$(".form-control input").on("focus", function () {
$(this).parent().addClass("active");
}).on("blur", function () {
$(this).parent().removeClass("active");
});
});
</script>
</body>
</html>