-2
Well, basically I have the following code with all the states of Brazil.
<select name="estado">
<option value="estado">Selecione o Estado</option>
<option value="ac">Acre</option>
<option value="al">Alagoas</option>
<option value="am">Amazonas</option>
<option value="ap">Amapá</option>
<option value="ba">Bahia</option>
<option value="ce">Ceará</option>
<option value="df">Distrito Federal</option>
<option value="es">Espírito Santo</option>
<option value="go">Goiás</option>
<option value="ma">Maranhão</option>
<option value="mt">Mato Grosso</option>
<option value="ms">Mato Grosso do Sul</option>
<option value="mg">Minas Gerais</option>
<option value="pa">Pará</option>
<option value="pb">Paraíba</option>
<option value="pr">Paraná</option>
<option value="pe">Pernambuco</option>
<option value="pi">Piauí</option>
<option value="rj">Rio de Janeiro</option>
<option value="rn">Rio Grande do Norte</option>
<option value="ro">Rondônia</option>
<option value="rs">Rio Grande do Sul</option>
<option value="rr">Roraima</option>
<option value="sc">Santa Catarina</option>
<option value="se">Sergipe</option>
<option value="sp">São Paulo</option>
<option value="to">Tocantins</option>
</select>
<br>
<select name="cidades">
<option value="cidade1">Cidade 1</option>
</select>
What it intended was to do a javascript that when selecting one of the states, appeared all the cities of that state in select "cities". That is to say depending on the state option school, it will display different values in select cities.
How can I do that?
Where the data about the cities will come from?
– Pablo Almeida
I put in the selects, I just want 1 javascript q make 1 condition, if it is that state, aparece x city.
– Gonçalo
How to select an option in a
<select>
and upload related data to another?– Renan Gomes
Dude, look at this post, I answered this to another person, see if it helps you.... I did it with pure JS even.... http://answall.com/questions/120759/comore-fazer-um-select-html-carregar-lista-de-op%C3%A7%C3%B5es-cada-vez-que-outro-select/120772#120772
– Guilherme Sanches
That’s right, only I want with 3 parameters, ie 2 subdivisions.
– Gonçalo