Salve, ho una domanda da fare:
ho bisogno di creare una tabella dinamica, la quale viene incrementata di righe quando l'utente clicca su un pulsante, io ho scritto questo codice:
<script type="text/javascript">
function insertRowPHP()
{
var tbl = document.getElementById('tblInsertRowPHP');
var iteration = tbl.tBodies[0].rows.length;
newRow = tbl.tBodies[0].insertRow(-1);
var newCell = newRow.insertCell(0);
newCell.innerHTML =iteration+1;
var newCell1 = newRow.insertCell(1);
var newCell2 = newRow.insertCell(2);
var el = document.createElement('input');
var el1= document.createElement('input');
el.type = 'text';
el.name = 'txtRow[]';
el.id = 'txtRow' + iteration;
el.size = 40;
el1.type = 'text';
el1.name = 'txtRow[]';
el.id = 'txtRow' + iteration;
el1.size = 40;
newCell1.appendChild(el);
newCell1.appendChild(el1);
}
</script>
Ora il problema è che non riesco a postare tutto il contenuto delle righe aggiunte.
Per cui se per esempio la tabella ha 4 colonne ed n righe quando l'utente clicca su submit, il form deve puntare su una script php il quale deve prendere il contenuto della tabella riga per riga in modo da essere salvato su DATABASE.
Spero di aver spiegato il problema. Spero qualcuno riesca ad aiutarmi!!!