0
I’m using the Bootstrap framework, and the Selectpicker class to receive city data by status. The script works well, returns data, but instead of inserting <option> Cidade X </option>
he just inserts Cidade X
. I know the problem is in class, but I don’t know how to fix it.
Class:
<div class="col-md-3 col-xs-4" id="cidade">
<select data-width="auto" id="municipio" name="municipio" class="selectpicker municipio">
<option value="0" disabled="disabled">Selecione o estado</option>
</select>
</div>
Script:
$(document).ready(function(){
$("#estado").change(function() {
var est = document.getElementById("estado").value;
debugger;
$.ajax({
type: 'post',
url: 'cidade.php',
data: {
cd_estado: est
},
success: function(dados) {
$(".municipio").html(dados);
}
});
});
});
I was able to solve my problem which was the same as the link: https://stackoverflow.com/questions/17941749/bootstrap-select-notworking
– Diego Braga