0
I have a select
of cities that is supplied dynamically with the query returned in the databases, but when the values in the option
the default value emptiness some preventing to select an empty row.
Look at:
Select
stocked:
Follow codes who supply the options
:
function func(){
if(ajax.readyState == 4 && ajax.status == 200){
eval(ajax.responseText);
if(dados.erro){
alert(convertHtml(dados.erro));
}else{
var vazio = "";
var cidades = dados.split(",");
var html = "";
for(var i = 0; i < cidades.length; i++)
{
html = '<option>'+cidades[i]+'</option>';
document.getElementById('cidade').innerHTML += html;
}
}
}
}
<label for="cidade">Cidade: <br>
<select name="cidade" id="cidade" value="<?=$MunNome?>" class="campos_menu" style="width:110px;">
<option value=""></option>
</select>
</label>
What is the code that calls this function? It seems to have some other code that manipulates the
select
– Gabriel Heming
@Gabrielheming he is calling an Onchange event of the UF select to be able to consult at the bank and return the cities.
– Igor Carreiro