0
Below a table in my view, I need that when marking the column in the checkbox is not sent the data to my other page, or do a check when searching the POST.
View:
<div class="large-12 columns" id="tabela" style="overflow-y: scroll; height: 80%; border: 0px solid;">
<div class="TableCSS">
<form method="POST" action="../controller/precontEnviaEmail">
<table>
<thead>
<tr>
<th>Nome</th>
<th>Email</th>
<th>Nº Fatura em atraso</th>
<th>Ação</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="text" value="teste1" name="nome[]"></td>
<td><input type="text" value="[email protected]" name="email[]"></td>
<td><input type="text" value="666666666" name="fatura[]"></td>
<td><input type="checkbox" value="" name="valida[]"></td>
</tr>
<tr>
<td><input type="text" value="teste2" name="nome[]"></td>
<td><input type="text" value="[email protected]" name="email[]"></td>
<td><input type="text" value="666666666" name="fatura[]"></td>
<td><input type="checkbox" value="" name="valida[]"></td>
</tr>
</tbody>
</table>
</div>
<input type="submit" class="tiny button">
</form>
</div>
Precontroller:
Here validate if checkbox is filled do not take the table row data only take what is not marked.
$nome = $_POST['nome'];
$email = $_POST['email'];
$fatura = $_POST['fatura'];
$valida= $_POST['valida'];
//Validação
Have you tried anything in the validation you need to do?
– Woss
I tried but I didn’t post because it won’t add what I need, I just need it to validate. I know how to do if it was only 1 given, however it is array. It would be something simple like if isset checkbox takes the data from the table row for me to deal with later if you have marked discard, something like that.
– KevinF
@Kevin. F , I edited my answer, agr works
– Wees Smith