Hi
I try develop my order form and I need a help with adding/copy records in the table.
I have table with 3 columns: one contains list, second contains text field, third button.
The aim is to choose item from list, than provide quantity and press add button to add next record/row (formula needs to copy the drop down list, quantity field must be EMPTY) plus add button next to row.
Now, copied record displays previous values.
More over I need Remove button in the row.
If any have other solution (based on check boxes add and remove button) let me know. Many thanks Eva


Below part of my code:


<script type="text/JavaScript">
function addRow(r){
var root = r.parentNode;//the root
var allRows = root.getElementsByTagName('tr');//the rows' collection
var cRow = allRows[0].cloneNode(true)//the clone of the 1st row
var cInp = cRow.getElementsByTagName('input');//the inputs' collection of the 1st row
for(var i=0;i<cInp.length;i++){//changes the inputs' names (indexes the names)
cInp[i].setAttribute('name',cInp[i].getAttribute('name')+'_'+(allRows.length+1))
}
var cSel = cRow.getElementsByTagName('select')[0];
cSel.setAttribute('name',cSel.getAttribute('name')+'_'+(allRows.length+1));//change the selecet's name
root.appendChild(cRow);//appends the cloned row as a new row
}
function shownames(){
var allInp=document.getElementsByTagName('input');
for(var i=0;i<allInp.length;i++){
alert(allInp[i].name)
}
}
</script>


<form action="FormtoEmail.php" method="get">
<table width="766" border="0" cellspacing="0" cellpadding="0">
<tr>

</tr><thead>
</thead><td width="140"><label><span class="style4">Product</span></label></td>
<td width="191"><label><span class="style4">quantity</span></label></td>
</thead>
<tbody>

</tbody><td width="324"><select name="Produkt">
<option>Select from list</option>
<option>Uniform</option>
<option>T-shirt</option>
<option>Color Belts</option>
<option>Mitts and Instep pads</option>
</select></td>

<td width="261"><input type="text" name="quantity" /></td>



<td width="181"><input name="button" type="button" value="Add" onclick="addRow(this.parentNode.parentNode)" /></td>
</tr>


</table>
<br /><br />
<input name="submit" type="submit" value="Send" />
<br />
<br />
</form>