I can not retrieve the value that is written from select
.
I have this recovery by input
that is working normally.
<td>
<div class="drop-down-select opcoes ">
<label for="bairro">Bairro:</label>
<input type="text" size="50" class="form-control" id="bairro" name="bairro" value = "<?php echo $bairro;?>" >
</div>
</td>
<td>
<div class="drop-down-select opcoes ">
<label for="rua">Rua:</label>
<input type="text" size="70" class="form-control" id="rua" name="rua" value = "<?php echo $rua;?>" >
</div>
</td>
But if possible, I wanted to retrieve this data from Select, follow the code below ...
<td width="160">
<div class="drop-down-select opcoes ">
<label for="bairro">Bairro:</label>
<select name="bairro" id="bairro" required>
<option value="">Selecione</option>
<?php foreach ($bairros as $bairro) { ?>
<option value="<?php echo $bairro['id'] ?>"><?php echo $bairro['nome'] ?></option>
<?php } ?>
</select>
</div>
</td>
<td>
<div class="drop-down-select opcoes ">
<label for="rua">Rua:</label>
<select name="rua" id="rua" disabled required>
<option value="<?php $rua; ?>">Selecione uma Rua</option>
</select>
</div>
</td>
This is the same dynamic select I use for the cadaster. Thanks in advance.