Jump to content

AndersonAlvesCoelho

Members
  • Content count

    1
  • Joined

  • Last visited

Community Reputation

0 Comum

About AndersonAlvesCoelho

  1. AndersonAlvesCoelho

    Como fazer dois select se conversarem

    Alguém pode me ajudar Quero que quando o "select" banca ao ser selecionado uma opção, habilita as opções no "select" assunto obs: infelizmente eu to usando esse filtro to em uma tabela so no banco de dados to usando php pdo Agradeço muito se me ajudarem . Queria deixar mais o menos desse jeito https://www.qconcursos.com/questoes-de-concursos/questoes Se quiserem ver ao vivo: https://andersonalvescoelho.com/quest.php Esse e o codigo do select q to usando <select class="form-control selectpicker" data-live-search="true" name="banca"> <?php $sql = "SELECT DISTINCT banca FROM tb_postagens"; $stmt = $conexao->prepare($sql); $stmt->execute(); $result = $stmt->fetchAll(); ?> <option>Banca</option> <?php foreach ($result as $exibe):?> <option value="<?php echo $exibe['banca'] ?>"><?php echo $exibe['banca'] ?></option> <?php endforeach; ?> </select> ___________________________________________________________________________ Esse e meu filtro de pesquisa Que contem o select <form action="#category" method="get" enctype="multipart/form-data"> <div class="row"> <div class="col-sm-3" > <div class="form-group"> <select class="form-control selectpicker" data-live-search="true" name="banca"> <?php $sql = "SELECT DISTINCT banca FROM tb_postagens"; $stmt = $conexao->prepare($sql); $stmt->execute(); $result = $stmt->fetchAll(); ?> <option>Banca</option> <?php foreach ($result as $exibe):?> <option value="<?php echo $exibe['banca']?>"><?php echo $exibe['banca'] ?></option> <?php endforeach; ?> </select> </div> </div> <div class="col-sm-3" > <div class="form-group"> <select class="form-control selectpicker" data-live-search="true" name="siglaOrgao"> <?php $sql = "SELECT DISTINCT siglaOrgao, orgao FROM tb_postagens"; $stmt = $conexao->prepare($sql); $stmt->execute(); $result = $stmt->fetchAll(); ?> <option>Orgão</option> <?php foreach ($result as $exibe):?> <option value="<?php echo $exibe['siglaOrgao'] ?>"><?php echo $exibe['orgao'] ?></option> <?php endforeach; ?> </select> </div> </div> <div class="col-sm-3" > <div class="form-group"> <select class="form-control selectpicker" data-live-search="true" name="ano"> <?php $sql = "SELECT DISTINCT ano FROM tb_postagens"; $stmt = $conexao->prepare($sql); $stmt->execute(); $result = $stmt->fetchAll(); ?> <option>Ano</option> <?php foreach ($result as $exibe):?> <option value="<?php echo $exibe['ano'] ?>"><?php echo $exibe['ano'] ?></option> <?php endforeach; ?> </select> </div> </div> <div class="col-sm-3" > <div class="form-group"> <select class="form-control selectpicker" data-live-search="true" name="assunto"> <?php $sql = "SELECT DISTINCT assunto FROM tb_postagens"; $stmt = $conexao->prepare($sql); $stmt->execute(); $result = $stmt->fetchAll(); ?> <option>Assunto</option> <?php foreach ($result as $exibe):?> <option value="<?php echo $exibe['assunto'] ?>"><?php echo $exibe['assunto'] ?></option> <?php endforeach; ?> </select> </div> </div> </div> <div class="row"> <div class="col-sm-3" > <div class="form-group"> <select class="form-control selectpicker" data-live-search="true" name="cargo"> <?php $sql = "SELECT DISTINCT cargo FROM tb_postagens"; $stmt = $conexao->prepare($sql); $stmt->execute(); $result = $stmt->fetchAll(); ?> <option>Cargo</option> <?php foreach ($result as $exibe):?> <option value="<?php echo $exibe['cargo'] ?>"><?php echo $exibe['cargo'] ?></option> <?php endforeach; ?> </select> </div> </div> <div class="col-sm-3" > <div class="form-group"> <select class="form-control selectpicker" data-live-search="true" name="formacao"> <?php $sql = "SELECT DISTINCT formacao FROM tb_postagens"; $stmt = $conexao->prepare($sql); $stmt->execute(); $result = $stmt->fetchAll(); ?> <option>Formação</option> <?php foreach ($result as $exibe):?> <option value="<?php echo $exibe['formacao'] ?>"><?php echo $exibe['formacao'] ?></option> <?php endforeach; ?> </select> </div> </div> <div class="col-sm-3" > <div class="form-group"> <select class="form-control selectpicker" data-live-search="true" name="especialidade"> <?php $sql = "SELECT DISTINCT especialidade FROM tb_postagens"; $stmt = $conexao->prepare($sql); $stmt->execute(); $result = $stmt->fetchAll(); ?> <option>Especialidade</option> <?php foreach ($result as $exibe):?> <option value="<?php echo $exibe['especialidade'] ?>"><?php echo $exibe['especialidade'] ?></option> <?php endforeach; ?> </select> </div> </div> <div class="col-sm-3" > <div class="form-group"> <select class="form-control selectpicker" data-live-search="true" name="tema"> <?php $sql = "SELECT DISTINCT tema FROM tb_postagens"; $stmt = $conexao->prepare($sql); $stmt->execute(); $result = $stmt->fetchAll(); ?> <option>Tema</option> <?php foreach ($result as $exibe):?> <option value="<?php echo $exibe['tema'] ?>"><?php echo $exibe['tema'] ?></option> <?php endforeach; ?> </select> </div> </div> </div> <div class="row"> <div class="col-sm-3" > <div class="form-group"> <select class="form-control selectpicker" data-live-search="true" name="qtdLinha"> <?php $sql = "SELECT DISTINCT qtdLinha FROM tb_postagens"; $stmt = $conexao->prepare($sql); $stmt->execute(); $result = $stmt->fetchAll(); ?> <option>Linhas</option> <?php foreach ($result as $exibe):?> <option value="<?php echo $exibe['qtdLinha'] ?>"><?php echo $exibe['qtdLinha'] ?></option> <?php endforeach; ?> </select> </div> </div> <div class="col-sm-3"> <div class="form-group"> <button type="submit" name="search-category" class="btn btn-primary">Filtrar</button> <button type="reset" class="btn btn-default">Limpar</button> </div> </div> </div> </form>
×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.