0
I have a table with 4 columns and several records. In this same table I have a button for each record.
By clicking this button I would like to take the value of a column and put in an inputText.
Code:
<input type="text" class="senha">
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>Mês/Ano</th>
<th>Senha</th>
<th>Máquina</th>
<th>Validade</th>
</tr>
</thead>
<tbody>
<?php
$i = 0;
while ($linha = $consulta->fetch(PDO::FETCH_ASSOC)) {
$i += 1;
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo mes_extenso($linha['mes']) .'/' .$linha['ano']; ?></td>
<td><?php echo $linha['senha_mensal']; ?></td>
<td><?php echo $linha['nome_maquina']; ?></td>
<td><?php echo date('d/m/Y', strtotime($linha['validade'])); ?></td>
<td class="text-center"><a class='btn btn-info btn-xs'><span class="glyphicon glyphicon-edit"></span> Copiar
<?php $linha['senha_mensal']; ?> </a></td>
<?php } ?>
</tr>
</tbody>
</table>
</div>
Post the table code you already have
– Leonardo
I edited the message by placing the code in the table;
– Ariel Inacio Correa
As soon as I can answer here.
– Leonardo