I have a table that in each line has two options checkbox, yes and no, as I show in the image:
Codetomountthetable:
$y=0;while($rows_cursos=mysqli_fetch_array($resultado_cursos)){$tabela1.='<tr>';$tabela1.='<td><inputtype="text" readonly="true" size="20" name= "Produto['.$y.']" id= "Produto" value="'.$rows_cursos['Descricao'].'"></td>';
$tabela1 .= '<td style="float:center"> <input type="checkbox" name= "Sim['.$y.']">';
$tabela1 .= '<td style="float:center"> <input type="checkbox" name= "Nao['.$y.']">';
$tabela1 .= '<td> <textarea type="text" id="Observacao" name="Observacao['.$y.']" rows="2" cols="30"></textarea>';
$tabela1 .= '</tr>';
$y++;
}
I wanted to force you to fill in one of the checkboxes on each of the lines and if any of the lines were not filled one of the checkbox would display an alert to warn you that it is missing a line.