-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
77 lines (64 loc) · 2.99 KB
/
index.php
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
<?php
require_once('dbcon.php');
?>
<!doctype html>
<html lang="en">
<head>
<title>Bootstrap 5 select dropdown with search box using Dselect & PHP8</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Adhir2099" />
<meta name="description" content="Bootstrap 5 select dropdown with search box using Dselect & PHP" />
<!-- Bootstrap v5.2.3-->
<link href="assets/css/bootstrapv5.css" rel="stylesheet"/>
<link href="assets/css/bootstrap-icons.css" rel="stylesheet">
<!-- Dselect library -->
<link rel="stylesheet" href="https://unpkg.com/@jarstone/dselect/dist/css/dselect.css">
<script src="https://unpkg.com/@jarstone/dselect/dist/js/dselect.js"></script>
<!-- Favicon -->
<link href="assets/img/world.png" type="image/x-icon" rel="icon"/>
<!-- Your custom css -->
<link href="assets/css/custom.css" rel="stylesheet" />
<!-- Bootstrap v5.2.3core JS-->
<script src="assets/js/bootstrap.bundle.min.js"></script>
</head>
<body class="d-flex flex-column min-vh-100">
<span id="forkongithub"><a href="https://github.com/adhir2099/dropdown-with-search-box">Fork me on GitHub</a></span>
<div class="container">
<h1 class="mt-2 text-center text-primary mb-5">Bootstrap 5 select dropdown with search box using Dselect & PHP</h1>
<div class="row">
<div class="col-md-3"> </div>
<div class="col-md-6">
<select name="select_box" class="form-select" id="select_box">
<option value="">Select country</option>
<?php
foreach($result as $row){
echo '<option value="'.$row["country_name"].'">'.$row["country_name"].'</option>';
}
?>
</select>
</div>
<div class="col-md-3"> </div>
</div>
</div>
<footer class="footer text-center mt-auto bg-primary">
<div class="container">
<div class="row">
<div class="col-lg-12">
<p class="lead mb-0">Bootstrap 5 Select dropdown with search box using Dselect & PHP8 <a href="https://github.com/adhir2099?tab=repositories"><i class="bi bi-github"></i></a></p>
</div>
</div>
</div>
</footer>
<div class="copyright py-4 text-center text-black bg-primary">
<div class="container"><small>Bootstrap 5 Select dropdown with search box using Dselect & PHP8</small></div>
</div>
</body>
</html>
<script>
let select_box_element = document.querySelector('#select_box');
dselect(select_box_element, {
search: true
});
</script>