-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
191 lines (182 loc) · 4.38 KB
/
test.html
File metadata and controls
191 lines (182 loc) · 4.38 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!DOCTYPE html>
<html>
<head>
<title>Test Form</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 600px;
margin: 20px auto;
padding: 20px;
}
.form-group {
margin-bottom: 15px;
}
label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
textarea,
select {
width: 100%;
padding: 8px;
border: 1px solid #ddd;
border-radius: 4px;
box-sizing: border-box;
}
.radio-group,
.checkbox-group {
margin-top: 5px;
}
button {
background-color: #4caf50;
color: white;
padding: 10px 15px;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
</style>
</head>
<body>
<h2>Test Form</h2>
<form id="testForm">
<!-- Text inputs -->
<div class="form-group">
<label for="name">Name:</label>
<input
type="text"
id="name"
name="name"
placeholder="Enter your name"
/>
</div>
<div class="form-group">
<label for="email">Email:</label>
<input
type="email"
id="email"
name="email"
placeholder="Enter your email"
/>
</div>
<!-- Number input -->
<div class="form-group">
<label for="age">Age:</label>
<input
type="number"
id="age"
name="age"
min="0"
max="120"
/>
</div>
<!-- Date input -->
<div class="form-group">
<label for="birthdate">Birth Date:</label>
<input
type="date"
id="birthdate"
name="birthdate"
/>
</div>
<!-- Select dropdown -->
<div class="form-group">
<label for="country">Country:</label>
<select
id="country"
name="country"
>
<option value="">Select a country</option>
<option value="us">United States</option>
<option value="uk">United Kingdom</option>
<option value="ca">Canada</option>
<option value="au">Australia</option>
</select>
</div>
<!-- Radio buttons -->
<div class="form-group">
<label>Gender:</label>
<div class="radio-group">
<input
type="radio"
id="male"
name="gender"
value="male"
/>
<label for="male">Male</label>
<input
type="radio"
id="female"
name="gender"
value="female"
/>
<label for="female">Female</label>
<input
type="radio"
id="other"
name="gender"
value="other"
/>
<label for="other">Other</label>
</div>
</div>
<!-- Checkboxes -->
<div class="form-group">
<label>Interests:</label>
<div class="checkbox-group">
<input
type="checkbox"
id="coding"
name="interests"
value="coding"
/>
<label for="coding">Coding</label>
<input
type="checkbox"
id="reading"
name="interests"
value="reading"
/>
<label for="reading">Reading</label>
<input
type="checkbox"
id="traveling"
name="interests"
value="traveling"
/>
<label for="traveling">Traveling</label>
</div>
</div>
<!-- Textarea -->
<div class="form-group">
<label for="comments">Comments:</label>
<textarea
id="comments"
name="comments"
rows="4"
placeholder="Enter your comments"
></textarea>
</div>
<!-- Submit button -->
<button type="submit">Submit</button>
</form>
<script>
// Prevent form submission for testing purposes
document
.getElementById("testForm")
.addEventListener("submit", function (e) {
e.preventDefault();
// console.log("Form submitted");
});
</script>
</body>
</html>