-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
76 lines (69 loc) · 1.76 KB
/
index.html
File metadata and controls
76 lines (69 loc) · 1.76 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Simple Form</title>
<link rel="stylesheet" href="styles.css" />
<style>
input {
border-radius: 6px; /* overrides external 10px */
}
</style>
</head>
<body>
<h1 style="margin-top: 0">User Registration</h1>
<form action="#">
<div class="input-group">
<label for="name">Name:</label>
<input
type="text"
id="name"
name="name"
placeholder="John Doe"
pattern="[A-Za-z ]{2,50}"
required
/>
<span class="error-message" data-error="name">
Name should only contain letters and be at least 2 characters long
</span>
</div>
<div class="input-group">
<label for="age">Age (18+):</label>
<input
type="number"
id="age"
name="age"
placeholder="25"
min="18"
max="120"
required
/>
<span class="error-message" data-error="age">
Age must be between 18 and 120
</span>
</div>
<div class="input-group">
<label for="email">Email:</label>
<input
type="email"
id="email"
name="email"
placeholder="john@example.com"
required
/>
<span class="error-message" data-error="email">
Please enter a valid email address
</span>
</div>
<button
type="submit"
class="btn"
style="background: skyblue; color: blue"
>
Submit
</button>
<button type="reset" class="btn">Reset</button>
</form>
</body>
</html>