nie znam prawie wcale JS ale napisałem coś takiego :
function dodaj() { var el1,el2; var cel = document.getElementById("cechy"); var tr;tr = document.createElement('tr'); var td;td = document.createElement('td'); var td2;td2 = document.createElement('td'); el1 = document.createElement('input'); el1.setAttribute('type', 'text'); el1.setAttribute('name', 'cecha[]'); el1.setAttribute('size', '50'); el2 = document.createElement('input'); el2.setAttribute('type', 'text'); el2.setAttribute('name', 'wartosc[]'); el2.setAttribute('size', '30'); cel.appendChild(tr); tr.appendChild(td); td.appendChild(el1); tr.appendChild(td2); td2.appendChild(el2); }
i nawet działa ale w miarę jedzenia apetyt rośnie i chciałbym żeby inputy pojawiały się nie po przez kliknięcie w link ale przy wpisaniu albo kliknięciu w input który pojawił się ostatni.
Np wpisuje wartości do inputa i wtedy pojawia się niżej kolejny, bo nie wiem ile ktoś cech będzie chciał wpisać jedną 10 albo 20.
Dzięki z góry