Redirect page through a select php

0

I would like to know how to redirect a page through select , since I need value of it.

<select name="setor" id="setor">
  <option value="">Selecionar Setor</option>
  <option value="age">Agenciamento</option>
  <option value="exp">Exportação</option>
  <option value="imp">Importação</option>
  <option value="int">Internação</option>
  <option value="pro">Processos</option>
</select>
    
asked by anonymous 03.08.2017 / 21:15

1 answer

1

You can do this using JavaScript .

Create a function in onChange by passing the chosen value as a parameter.

It will call the function and send it to a page with the appropriate value as parameter.

function redirectPage(v) {
    document.location.href = 'pagina.php?param='+v;    
}
<select name="setor" id="setor" onChange="redirectPage(this.value)">
  <option value="">Selecionar Setor</option>
  <option value="age">Agenciamento</option>
  <option value="exp">Exportação</option>
  <option value="imp">Importação</option>
  <option value="int">Internação</option>
  <option value="pro">Processos</option>
</select>
    
03.08.2017 / 21:19