0
I have a form in html, sending data to php code however I use the button input type="submit"
to send the data and wanted to send the form by clicking the checkbox.
Follow my code below:
insira o código aquiecho '<tr>';
echo '<form id="teste" action="banco.php" method="post"><td><input id="check" name="bike'.$fetch['id'].'" type="checkbox" onclick="document.getElementById("teste").submit()" value="on" class="confirmacoes"><a href="banco.php"> </a></td><form>';
echo '<td >'.$fetch['id'].'</td>';
echo '<td >'.$fetch['turno'].'</td>';
echo '<td>'.$fetch['data'].'</td>';
echo '<td>'.$fetch['tubetes_prod'].'</td>';
echo '<td>'.$fetch['tubetes_caixadetubete'].'</td>';
echo '<td>'.$fetch['logs_rebobinados'].'</td>';
echo '<td>'.$fetch['logs_colados'].'</td>';
echo '<td>'.$fetch['logs_acumulador'].'</td>';
echo '<td>'.$fetch['rolo_produzido'].'</td>';
echo '<td><a id="logo-container" href="'.$fetch['tipo_prod'].'" class="brand-logo"><img src="teste.png" /></a></td>';
echo '<td><a id="logo-container" href="'.$fetch['tipo_prod'].'" class="brand-logo"><img src="teste.png" /></a></td>';
echo '<td><a id="logo-container" href="'.$fetch['tipo_prod'].'" class="brand-logo"><img src="teste.png" /></a></td>';
echo '<td><a id="logo-container" href="'.$fetch['tipo_prod'].'" class="brand-logo"><img src="teste.png" /></a></td>';
echo '<td><a id="logo-container" href="'.$fetch['tipo_prod'].'" class="brand-logo"><img src="teste.png" /></a></td>';
echo '<td><a id="logo-container" href="'.$fetch['tipo_prod'].'" class="brand-logo"><img src="teste.png" /></a></td>';
echo '<td><a id="logo-container" href="'.$fetch['tipo_prod'].'" class="brand-logo"><img src="teste.png" /></a></td>';
$i++;
};
echo"<input type='submit' id='teste' name='teste'>";
What would this test be before the id of my form?
– user127289
your form is with this id, it was just for you to understand. It would look like this: Document.getElementById("test"). Submit();
– Mbosso