<section id="contact" class="contact">
<div class="container">
<div class="section-title">
<h2 data-aos="fade-up">Insert ISR</h2>
</div>
<div class="row justify-content-center" data-aos="fade-up" data-aos-delay="300">
<div class="col-xl-9 col-lg-12 mt-4">
<form action="../proses" method="post" >
<div class="form-group">
<div class="form-group">
<label class="font-weight-bold" for="fullname" >Bisnis Unit</label>
<select class="form-control" name="bisnisunit" id="bs" required>
<option>Bisnis Unit</option>
<?php
$query2 = mysqli_query($con,"SELECT * FROM bisnisunit ");
while($data = mysqli_fetch_array($query2)) {
?>
<option><?php echo $data['bisnisunit']; ?></option>
<?php
}
?>
</select>
</div>
<div class="form-group">
<label class="font-weight-bold" for="fullname">Cabang</label>
<select class="selectpicker form-control" data-live-search="true" name="cabang" id="cbn" required>
<option>Cabang</option>
</select>
</div>
<div class="form-group">
<input type="submit" value="save" name="insertcabang" class="btn btn-success btn-lg" />
</div>
</form>
</div>
</div>
</div>
</section>
<script>
$("#bs").change(function(){
var id_bisnis = $("#bs").val();
$.ajax({
type: "POST",
dataType: "html",
url: "getcabang.php",
data: "bs="+id_bisnis,
success: function(msg){
if(msg == ''){
swal("Failed!", "Masukan Pilihan !", "error");
}
else{
$("#cbn").html(msg).selectpicker();
}
}
});
});
</script>`
I want to add a search for select but, when I add a selectpicker to the select tag the code created for change select branch doesn't work. Meanwhile, when I delete the selectpicker, my code runs normally, that is, when I select one of the business units, select on the branch will display the name of the branch that matches the selected business unit only. what is the solution?