Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo "<input type='hidden' name='idRede' value=" . $idRede . " /> ";
- echo '
- <label class="labelPequeno" for="idRegiao">Região</label> :
- <select name="idRegiao" id="idRegiao" class="inputTextMedio required">
- <option value="" selected>Escolha a Rede primeiro</option>
- </select> <br/>
- $("#idRede").on("change", function () {
- $.ajax({
- url: "_scripts/_php/_buscas/buscarDadosRegioes.php",
- type: "POST",
- dataType: "json",
- data: {
- idRede: $("#idRede").val()
- },
- beforeSend: function() {
- $("#imgCarregando").css('display','block');
- },
- success: function (result) {
- $("#imgCarregando").css('display','none');
- $('#idRegiao').find('option').remove();
- if (result == null){
- $("#idRegiao").append("<option value=>Sem Regiões</option>");
- } else {
- $("#idRegiao").append("<option value=>Escolha a Região</option>");
- result.forEach(function(option){
- $("#idRegiao").append("<option value=" + option["idRegiao"] + ">" + option["nome"] + "</option>")
- });
- }
- }
- });
- });
Add Comment
Please, Sign In to add comment