ciao a tutti,
Ho un problema, non riesco a recuperare i valori da un tabella generata dinamicamente...
Vi posto il codice, non so più che fare![]()
![]()
![]()
Per aggiungere righe
come faccio a ciclare gli input text nelle righe?codice:function aggiungiriga(){ var doc = document.forms[0]; var i = parseInt(doc.hiddenRow.value)+1; var tbody = document.getElementById("tblFattura").getElementsByTagName("tbody")[0]; var row = document.createElement("tr"); //creo i vari TD var td1 = document.createElement("td"); var td2 = document.createElement("td"); var td3 = document.createElement("td"); var td4 = document.createElement("td"); //creo i controlli all'interno delle celle var inputDescrizione = document.createElement("textarea"); inputDescrizione.setAttribute('cols','31'); inputDescrizione.setAttribute('rows','4'); var checkSave = document.createElement("input"); checkSave.setAttribute('type','checkbox'); checkSave.setAttribute('checked',true); checkSave.setAttribute('id','cBox'+i); var inputPrezzo = document.createElement("input"); inputPrezzo.setAttribute('type','text'); inputPrezzo.setAttribute('size','10'); inputPrezzo.setAttribute('id','txtPrezzo'); var inputQta = document.createElement("input"); inputQta.setAttribute('type','text'); inputQta.setAttribute('size','2'); inputQta.setAttribute('value','1'); var inputImporto = document.createElement("input"); inputImporto.setAttribute('type','text'); inputImporto.setAttribute('size','15'); //inserisco i controlli nelle celle td1.appendChild (inputDescrizione); td1.appendChild (checkSave); td2.appendChild (inputPrezzo); td3.appendChild (inputQta); td4.appendChild (inputImporto); //inserisco le celle nella riga row.appendChild(td1); row.appendChild(td2); row.appendChild(td3); row.appendChild(td4); //aggiungo la riga alla tabella tbody.appendChild(row); doc.hiddenRow.value = parseInt(doc.hiddenRow.value) + 1; }
Se avete qualcjhe suggerimento ve ne sarei grato in eterno...
Grazie e ciao a tutti![]()

Rispondi quotando
