How to set the select after load... help!
Hello guys, the question that I have for you is very simple to resolve I think.
I have to combobox, when the user select the first combobox, the second combobox change. After change, it´s show the first data that is in database (the combobox is loading data from a database). What I would like to do is after combobox get the data, it show "Select here your option" and not the fist data from database. Can you understand me?
He is the code for a best look.
- $(document).ready(function(){
$("select[name=Empresas]").change(function(){
$("select[name=Unidades]").html('<option value="0">Carregando...</option>');
$.post("unidades.php",
{Empresas:$(this).val()},
function(valor){
$("select[name=Unidades]").html(valor);
}
)
})
})
Can anyone give an ideia?
Thanks!