-
Notifications
You must be signed in to change notification settings - Fork 0
/
formelements.html
336 lines (298 loc) · 15 KB
/
formelements.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
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form Elements Preview</title>
<!-- CSS (Bootstrap) inclusion -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
</head>
<body class="bg-light">
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="index.html">HTML Elements</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="datatable.html">Data Table</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="formelements.html">Form Elements</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Hero Section -->
<div class="container-fluid bg-dark text-light text-center py-5">
<div class="container">
<h1 class="display-4">Form Elements</h1>
<p class="lead">Form Elements Preview offers a customized implementation for Form Elements such as textbox,
checkbox, radio button, dropdown (simple and with search), dropdown multiple select, Bootstrap
Duallistbox and Date Time Picker.</p>
</div>
</div>
<!-- Text Box Elements Section -->
<div class="container form-section my-5">
<h3>Text Boxes and Text Areas</h3>
<form>
<!-- Default Size Textbox -->
<div class="mb-3">
<label for="mediumTextInput" class="form-label">Default Text Input</label>
<input type="text" class="form-control" id="textInput" placeholder="Enter text here">
</div>
<!-- Textarea for Lengthy Paragraphs -->
<div class="mb-3">
<label for="paragraphTextArea" class="form-label">Paragraph Text Area</label>
<textarea class="form-control" id="paragraphTextArea" rows="6"
placeholder="Enter your lengthy paragraph here..."></textarea>
</div>
<!-- Textbox with Custom Width Using Bootstrap Grid -->
<div class="row">
<div class="col-md-6 mb-3">
<label for="halfWidthTextInput" class="form-label">Half-Width Text Input (50%)</label>
<input type="text" class="form-control" id="halfWidthTextInput"
placeholder="50% width on medium screens">
</div>
<div class="col-md-4 mb-3">
<label for="thirdWidthTextInput" class="form-label">Third-Width Text Input (33%)</label>
<input type="text" class="form-control" id="thirdWidthTextInput"
placeholder="33% width on medium screens">
</div>
</div>
<!-- Small Textbox -->
<!-- <div class="mb-3">
<label for="smallTextInput" class="form-label">Small Text Input</label>
<input type="text" class="form-control form-control-sm" id="smallTextInput"
placeholder="Small text input">
</div> -->
<!-- Large Textbox -->
<!-- <div class="mb-3">
<label for="largeTextInput" class="form-label">Large Text Input</label>
<input type="text" class="form-control form-control-lg" id="largeTextInput"
placeholder="Large text input">
</div> -->
</form>
</div>
<div class="container my-5">
<h3>Responsive Textboxes</h3>
<!-- Responsive Textboxes in One Row -->
<div class="row">
<!-- Success Textbox -->
<div class="col-md-4 mb-3">
<label for="successInput" class="form-label">Success Textbox</label>
<input type="text" class="form-control is-valid" id="successInput" placeholder="Looks good!">
<div class="invalid-feedback">
Success text input.
</div>
</div>
<!-- Warning Textbox -->
<div class="col-md-4 mb-3">
<label for="warningInput" class="form-label">Warning Textbox</label>
<input type="text" class="form-control is-warning" id="warningInput" placeholder="Be cautious!">
<div class="invalid-feedback">
Warning text input.
</div>
</div>
<!-- Error Textbox -->
<div class="col-md-4 mb-3">
<label for="errorInput" class="form-label">Error Textbox</label>
<input type="text" class="form-control is-invalid" id="errorInput" placeholder="Something went wrong!">
<div class="invalid-feedback">
Please provide a valid input.
</div>
</div>
</div>
</div>
<!-- Check Box Elements Section -->
<div class="container form-section my-5">
<h3>Check Boxes</h3>
<form>
<!-- Checkbox -->
<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="checkBox1">
<label class="form-check-label" for="checkBox1">Check me out</label>
</div>
<!-- Checkbox Group -->
<div class="mb-3">
<label class="form-label">Checkbox Group</label><br>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="checkBox12" value="option1">
<label class="form-check-label" for="checkBox12">Option 1</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="checkBox13" value="option2">
<label class="form-check-label" for="checkBox13">Option 2</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="checkBox14" value="option3">
<label class="form-check-label" for="checkBox14">Option 3</label>
</div>
</div>
<!-- Inline Checkboxes -->
<div class="mb-3">
<label class="form-label">Inline Checkboxes</label><br>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="checkBox2" value="option1">
<label class="form-check-label" for="checkBox2">Option 1</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="checkBox3" value="option2">
<label class="form-check-label" for="checkBox3">Option 2</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="checkBox4" value="option3" disabled>
<label class="form-check-label" for="checkBox4">Option 3</label>
</div>
</div>
<!-- Disabled Checkbox -->
<div class="mb-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="checkBox6" disabled>
<label class="form-check-label" for="checkBox6">Disabled checkbox</label>
</div>
</div>
</form>
</div>
<!-- Radio Button Elements Section -->
<div class="container form-section my-5">
<h3>Radio Buttons</h3>
<form>
<!-- Radio Buttons -->
<div class="mb-3">
<label class="form-label">Inline Radio Options</label><br>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="radioOptions1" id="radio1" value="option1">
<label class="form-check-label" for="radio1">Option 1</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="radioOptions1" id="radio2" value="option2">
<label class="form-check-label" for="radio2">Option 2</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="radioOptions1" id="radio3" value="option3">
<label class="form-check-label" for="radio3">Option 3</label>
</div>
</div>
<!-- Radio Button Groups -->
<div class="mb-3">
<label class="form-label">Radio Buttons Group</label><br>
<div class="form-check">
<input class="form-check-input" type="radio" name="radioOptions2" id="radio11" value="option1">
<label class="form-check-label" for="radio11">Option 1</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="radioOptions2" id="radio12" value="option2">
<label class="form-check-label" for="radio12">Option 2</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="radioOptions2" id="radio13" value="option3"
disabled>
<label class="form-check-label" for="radio13">Option 3</label>
</div>
<!-- Clear My Choice Link -->
<span class="clear-selection" id="clearRadioSelection">Clear my choice.</span>
</div>
</form>
</div>
<!-- Dropdown Elements Section -->
<div class="container form-section my-5">
<h3>Dropdown Elements</h3>
<!-- Simple Dropdown Element Section -->
<div class="row">
<!-- Simple Dropdown -->
<div class="col-md-6 mb-3">
<label for="simpleSelectDropdown" class="form-label">Simple Dropdown</label>
<select class="form-select" id="simpleSelectDropdown">
<option selected>Select an option</option>
<option value="1" disabled>Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
</div>
<!-- JS Enabelled Dropdown -->
<div class="col-md-6 mb-3">
<label for="jsEnabelledDropdown" class="form-label">JS Enabelled Dropdown (Check console)</label>
<select class="form-select" id="jsEnabelledDropdown">
<option selected>Select an option</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
</div>
<!-- Single Country Select Dropdown -->
<div class="col-md-6 mb-3">
<label for="countrySingleSelectDropdown" class="form-label">Select a country</label>
<select id="countrySingleSelectDropdown" class="form-select">
<option selected>Select a country</option>
<!-- Options will be populated here using JavaScript -->
</select>
</div>
<!-- Multiple Counties Select Dropdown -->
<div class="form-group col-md-6 mb-3">
<label for="countryMultipleSelectDropdown" class="form-label">Select multiple countries</label>
<div id="countryMultipleSelectDropdown" class="dropdown-container">
<div id="selectedItems" class="selected-items"></div>
<div id="dropdownList" class="dropdown-list"></div>
</div>
</div>
<!-- Dropdown with Search -->
<!-- <div class="col-md-6 mb-3">
<label for="searchSelect" class="form-label">Dropdown with Search</label>
<select class="form-select" id="searchSelect">
<option selected>Search and select an option</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
</div> -->
</div>
</div>
<!-- Bootstrap Duallistbox Section -->
<div class="container mt-5">
<h3>Bootstrap Duallistbox Element</h3>
<div class="row">
<div class="col-md-5 mb-5">
<label for="available" class="form-label">Available</label>
<input type="text" id="searchAvailable" class="form-control mb-2" placeholder="Search...">
<select id="available" class="form-control" size="5" multiple>
<!-- Options will be populated here using JavaScript -->
</select>
</div>
<div class="col-md-2 d-flex align-items-center justify-content-center">
<div class="text-center">
<button id="moveRight" class="btn btn-primary mb-2">>></button><br>
<button id="moveLeft" class="btn btn-primary mt-2"><<</button>
</div>
</div>
<div class="col-md-5 mb-5">
<label for="selected" class="form-label">Selected</label>
<input type="text" id="searchSelected" class="form-control mb-2" placeholder="Search...">
<select id="selected" class="form-control" size="5" multiple></select>
</div>
</div>
</div>
<!-- Footer -->
<footer class="bg-dark text-light py-4">
<div class="container text-center">
<p class="mb-0">© 2024 HTML Elements. Talha Yaseen Zafar 😊</p>
</div>
</footer>
<!-- including JavaScript files-->
<script src="script.js"></script>
<!-- Include Bootstrap libraries -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
crossorigin="anonymous"></script>
</body>
</html>