-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
74 lines (71 loc) · 3.23 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Form validation demo</title>
<link rel="stylesheet" href="style.css">
<script src="script.js" defer></script>
</head>
<body>
<div class="page">
<header class="page__header">Form validation demo</header>
<main class="page__main">
<form action="#" class="form">
<div class="form__section">
<!-- Обязательное поле -->
<label for="name">Имя:</label>
<input type="text" id="name" name="name" required>
</div>
<div class="form__section">
<!-- Ограничение по паттерну -->
<label for="mname">Отчество:</label>
<input type="text" id="mname" name="mname" pattern="[А-Я][а-я]+">
</div>
<div class="form__section">
<!-- Ограничение по длине -->
<label for="sname">Фамилия:</label>
<input type="text" id="sname" name="sname" minlength="3" maxlength="15">
</div>
<div class="form__section">
<!-- Дата -->
<label for="bdate">Дата рождения:</label>
<input type="date" id="bdate" name="bdate">
</div>
<div class="form__section">
<!-- Электронная почта -->
<label for="email">E-mail:</label>
<input type="email" id="email" name="email">
</div>
<div class="form__section">
<!-- Числовые поля -->
<label for="teeth">Количество зубов:</label>
<input type="number" id="teeth" name="teeth" min="0">
</div>
<div class="form__section">
<!-- Телефон -->
<label for="telephone">Телефон:</label>
<input type="tel" id="telephone" name="telephone"\>
</div>
<div class="form__section">
<!-- URL -->
<label for="homepage">Домашняя страница:</label>
<input type="url" id="homepage" name="homepage"\>
</div>
<div class="form__section">
<!-- Валидация через JS -->
<label for="pass">Пароль:</label>
<input type="password" id="pass" name="pass"\>
</div>
<div class="form__section">
<button type="submit" class="submit">Отправить</button>
<button type="reset" class="reset">Очистить</button>
</div>
</form>
<section class="student-list"></section>
</main>
<footer class="page__footer">©2K19, Aleksandr Kozlov</footer>
</div>
</body>
</html>