0
Good morning!
Here’s the thing, I got a combobox
which displays all the records of a table, until that part I managed to unroll. However, I need to show an input when one of these records is selected and hide this same input when nothing is selected. My difficulty is time to take the option value and make the comparison, combo
.
<label for="empresa">empresas *</label></a><br/>
<select name="empresa" id="empresa"
onchange="ExibirDiv(this.value)" class="form-control">
<option value="">SELECIONE</option>
<?php
$parametro_empresa = filter_input(INPUT_GET,"parametro_empresa");
$empresa = "SELECT * FROM tb_empresa WHERE
razaosocial_pessoafisica LIKE '%" . $parametro_empresa . "%'";
$recebe_empresas = mysqli_query($con, $empresa);
while ($linha = mysqli_fetch_array($recebe_empresas)) {
echo '<option value="' . $linha['codigo_empresa'] . '">' .
$linha['razaosocial_pessoafisica'] . '</option>';
}
?>
</select>
Explain yourself better. Show an input when ONE of these options is selected OR when any of these options is selected?
– user60252
opa, actually it is when any of these options is selected
– user122281
Welcome, if any answer has served you be sure to mark it as accepted. See how in https://i.stack.Imgur.com/evLUR.png
– user60252
Read this post to understand how things work around here https://answall.com/help/mcve
– user60252