I'm trying to make a dynamic insert using ajax. as shown in the image below. I want to be able to click on send from any line and make the post referring to it
HowcanIdothis?
<scripttype="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<table style="width: 20%;">
<thead>
<tr>
<th style="width: 1%;" class="center">Cod.</th>
<th style="width: 18%;" >Produtos</th>
<th class="text-center" style="width: 8%;">Valor</th>
<th style="width: 5%;"></th>
</tr>
</thead>
<tbody>
<?
$cmd = "SELECT * FROM produtos where id_transfer = '1' limit 5";
$produtos = mysql_query($cmd)or die( mysql_error());
$count=mysql_num_rows($produtos);
while ($linha = mysql_fetch_array($produtos)) {
$id_produto = $linha['id_produtos'];
$id_transfer = $linha['id_transfer'];
$cheva = $linha['chave'];
?>
<tr class="selectable">
<td class="center"><input type="text" id="campo1" value="<?echo $id_transfer1?>" /></td>
<td class="important"><input type="text" id="campo2" value="<?echo "$id_produto"?>" /></td>
<td class="text-center"><input type="text" id="campo3" value="<?echo $chave?>" /></td>
<td class="center">
<input type="submit" class="btn btn-danger" onclick="inserir_registo()" /><i class="fa fa-arrow-right"></i></i></a>
</td>
</tr>