salve a tutti
problema: ho un campo checkbox in una tabella che su apertura pagina ha solo una riga ( l'utente può aggiungere o eliminare le righe a piacimento) perché lo script su onClick sulla prima riga (di default) viene eseguito e non sulle righe successive inserite da script? dove sbaglio? GRAZIE
ho la form:
<form id="myFRM" ...>
<table id="id1" border="1" width="80%" align="center">
<tbody>
<tr>
<td>1</td>
<td><input type="text" size="39" name="fam_cg1" id="fam_cg1" disabled="disabled"></td>
<td><input type="checkbox" name="fam_deposita1" id="fam_deposita1" value="1" onClick="ctr(this)"></td>
</tr>
</tbody>
</table>
ho uno script con cui aggiungo le righe alla tabella:
...
righe++;
var tbody = document.getElementById(id).getElementsByTagName(" TBODY")[1];
var row = document.createElement("TR")
var td0=document.createElement("TD")
td0.appendChild(document.createTextNode(righe))
var td1 = document.createElement("TD")
var ip1 = document.createElement("input")
ip1.type="text";
ip1.size="39";
ip1.disabled="disabled";
ip1.name="fam_cg" + righe;
ip1.id="fam_cg" + righe;
td1.appendChild(ip1);
var td4 = document.createElement("TD")
var ip4 = document.createElement("input")
ip4.type="checkbox";
ip4.name="fam_deposita" + righe;
ip4.id="fam_deposita" + righe;
ip4.value="1";
ip4.onClick="ctr(this)";
td4.appendChild(ip4);
row.appendChild(td0);
row.appendChild(td1);
row.appendChild(td4);
tbody.appendChild(row);