-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
120 lines (98 loc) · 5.18 KB
/
index.html
File metadata and controls
120 lines (98 loc) · 5.18 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./assets/css/style.css">
<title>Form validation</title>
</head>
<body>
<div class="main">
<form action="" method="POST" class="form" id="register-form">
<h3 class="heading">Thành viên đăng ký</h3>
<p class="desc">Cùng nhau học lập trình miễn phí tại F8 ❤️</p>
<div class="spacer"></div>
<div class="form-group">
<label for="fullname" class="form-label">Tên đầy đủ</label>
<input id="fullname" name="fullname" rules="required" type="text" placeholder="VD: Sơn Đặng" class="form-control">
<span class="form-message"></span>
</div>
<div class="form-group">
<label for="email" class="form-label">Email</label>
<input id="email" name="email" rules="required|email" type="text" placeholder="VD: email@domain.com" class="form-control">
<span class="form-message"></span>
</div>
<div class="form-group">
<label for="password" class="form-label">Mật khẩu</label>
<input id="password" name="password" rules="required|min:5" type="password" placeholder="Nhập mật khẩu" class="form-control">
<span class="form-message"></span>
</div>
<div class="form-group">
<label for="password_confirmation" class="form-label">Nhập lại mật khẩu</label>
<input id="password_confirmation" name="password_confirmation" rules="isConfirmed:#password" placeholder="Nhập lại mật khẩu" type="password" class="form-control">
<span class="form-message"></span>
</div>
<div class="form-group">
<label for="avatar" class="form-label">Ảnh đại diện</label>
<input id="avatar" name="avatar" rules="required" type="file" class="form-control">
<span class="form-message"></span>
</div>
<div class="form-group">
<label for="province" class="form-label">Tỉnh/TP</label>
<select id="province" name="province" rules="required" class="form-control">
<option value="">-- Chọn Tỉnh/TP</option>
<option value="hni">Hà Nội</option>
<option value="hpg">Hải Phòng</option>
</select>
<span class="form-message"></span>
</div>
<div class="form-group">
<label for="password_confirmation" class="form-label">Giới tính</label>
<div class="form-input">
<div>
<input name="gender" rules="required" type="radio" value="male" class="form-control">
<span>Nam</span>
</div>
<div>
<input name="gender" rules="required" type="radio" value="female" class="form-control">
<span>Nữ</span>
</div>
<div>
<input name="gender" rules="required" type="radio" value="other" class="form-control">
<span>Khác</span>
</div>
</div>
<span class="form-message"></span>
</div>
<div class="form-group">
<label for="password_confirmation" class="form-label">Giới tính</label>
<div class="form-input">
<div>
<input name="gender2" rules="required" type="checkbox" value="male" class="form-control">
<span>option1</span>
</div>
<div>
<input name="gender2" rules="required" type="checkbox" value="female" class="form-control">
<span>option2</span>
</div>
<div>
<input name="gender2" rules="required" type="checkbox" value="other" class="form-control">
<span>option3</span>
</div>
</div>
<span class="form-message"></span>
</div>
<button class="form-submit">Đăng ký</button>
</form>
</form>
</div>
<script src="./validator.js"></script>
<script>
var form = new Validator('#register-form');
form.onSubmit = function(data) {
console.log(data)
}
</script>
</body>
</html>