1
I need to know what the user has chosen within a <select>
.
In the code below I need to know the code of the collection chosen by the user, to show the items that have not yet been collected.
<p align="left">Nº da Coleta <br>
<?php
echo ("<select name=\"colCodigo\">");
$coletas = new Coletas();
$coletas = $coletas->distinct();
foreach ($coletas as $c)
{
$cod = $c["colCodigo"];
echo ("<option>$cod</option>");
}
echo ("</select>");
?>
In this code no part serves to know which one is chosen.
– Jorge B.
You need to put a
value
in hisoption
– Amanda Lima