Good morning, I'm trying to make a form in a loop for each row of the table, when the user clicks the button on one row, takes the data from that row and loads it on another page, but for some reason in the loop the inputs do not are inside the form, follow the code of the loop:
if($total_row > 0)
{
foreach($data as $row)
{
$output .= '
<tr>
<form action="monitor/info" method="POST">
{{ csrf_field() }}
<td> <input type="text" readonly="" style="width: 310px" name="nome" id="nome" value="'.$row->nome.'" /></td>
<td> <input type="text" readonly="" style="width: 80px" name="usuariox" id="usuariox" value="'.$row->usuario_x.'" /></td>
<td> <input type="text" readonly="" style="width: 100px" name="aspect" id="aspect" value="'.$row->aspect.'" /></td>
<td> <input type="text" readonly="" name="supervisor" id="supervisor" value="'.$row->supervisor.'" /></td>
<td> <input type="text" readonly="" style="width: 70px" name="setor" id="setor" value="'.$row->setor.'" /></td>
<td> <input type="submit" class="btn btn-primary" value="Criar Laudo"></td>
</form>
</tr>
';
}
}
else
{
$output = '
<tr>
<td align="center" colspan="5">Nehum registro encontrado!</td>
</tr>
';
}
Follow the browser as interpreted:
Can anyone tell me where I'm wrong?