I have these two fields of select, the first article to change fills the 2nd.
By doing POST only saves the values of section (this generated dynamically) but the article does not save.
ListArticle:
function listaArticulos()
{
global $conexion;
$stmt = $conexion->prepare("SELECT numero_articulo FROM articulos");
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($stmt1);
while ($stmt->fetch())
{
echo "<option value=" . $stmt1 . ">" . $stmt1 . "</option>";
}
$stmt->close();
}
HTML
Select the inflicted item:
Select an article:
<select id="apartado" onchange="obtenerDesc()" name="apartado">
<option value="0">Seleccione primero un artículo</option>
</select>
</td>
</tr>
POST:
<?php
$articulo_falta = $_POST["articulo"];
echo $articulo;
$aparte_falta = $_POST["apartado"];
echo $aparte_falta;
?>
Result:
Undefined variable: article
4