0
I got the following select
:
<label>Para</label>
<div class="input_field">
<select class="form-control" name="Para[]" id="Para" multiple>
<option></option>
<?php
$sql = "SELECT A.Discricao FROM(SELECT Discricao FROM raddb.Grupo
UNION ALL
SELECT nome FROM raddb.usuarios) AS A ORDER BY A.Discricao ASC";
$qr = mysqli_query($conn, $sql);
while($ln = mysqli_fetch_assoc($qr)){
echo '<option value="'.$ln['Discricao'].'">'.$ln['Discricao'].'</option>';
}
?>
</select>
And I intend to put this search filter inside the select
as in the image:
I added the following libraries:
<link href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.jquery.min.js"></script>
I added it to the select class chosen-select
Then in the js
placed:
$(document).bind("pageinit", function() {
$(".chosen-select").chosen();
});
But the text box to write and search does not appear, as shown in the image:
a libs are these
<link rel="stylesheet" href="/wordpress/wp-content/themes/sparkling/assets/css/chosen.css">
,<script src="/wordpress/wp-content/themes/sparkling/assets/js/chosen.jquery.js"></script>
,<script src="/wordpress/wp-content/themes/sparkling/assets/js/chosen.jquery.min.js"></script>
,<script src="/wordpress/wp-content/themes/sparkling/assets/js/chosen.proto.js"></script>
,<script src="/wordpress/wp-content/themes/sparkling/assets/js/chosen.proto.min.js"></script>
,<link rel="stylesheet" href="/wordpress/wp-content/themes/sparkling/assets/css/chosen.min.css">
– Bruno
does the search but does not create the input as in your example.
– Bruno
You read the whole answer?
class="form-control chosen-select"
– Ivan Ferrer