-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm Vali
29 lines (29 loc) · 970 Bytes
/
Form Vali
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form Validation Example</title>
<style>
input:required:invalid,
input:focus:invalid {border-color: red;input:required:valid {border-color: green;}
.error-message {color: red;font-style: italic;}
</style>
</head>
<body>
<h1>Form Validation Example</h1>
<form id="myForm">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required><br>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required><br>
<label for="birthdate">Birthdate:</label>
<input type="date" id="birthdate" name="birthdate" required><br>
<label for="age">Age:</label>
<input type="number" id="age" name="age" min="18" max="100" required><br>
<input type="submit" value="Submit">
</form>
</body>
</html>