Dynamically Creating New Rows

wxdqz

New Member
Hi guys not sure if this should be classed as a DHTML question or Javascript or even ASP but I need some help.

I have a page that uses this javascript code to dynamically add rows to a table when a tick box is checked. It will then disable the tick box so that it cannot be cliked again:

<script type="text/javascript">
function insRow()
{
RowValue=document.forms.myform.valuebox.value
RowValue=(RowValue*1)+1

var x=myTable.insertRow()
var a=x.insertCell(0)
var b=x.insertCell(1)
var c=x.insertCell(2)
a.innerHTML="<p align='center'>" + WarehouseMaster.innerhtml + "</p>"
b.innerHTML="<p align='center'><input type='text' name='Req" + RowValue + "' size='5'></p>"
c.innerHTML="<p align='center'><input type='checkbox' name='checkbox" + RowValue + "' value='http://www.webdeveloper.com/forum/archive/index.php/ON' onclick='insRow()'></p>"
NewRowCount.innerHTML="<input type='text' name='valuebox' size='5' value='http://www.webdeveloper.com/forum/archive/index.php/" + RowValue + "'>"

var t=document.forms.myform
DisValue=RowValue*3
t[DisValue].disabled=true
}
</script>

The problem I'm having is that this row:

a.innerHTML="<p align='center'>" + WarehouseMaster.innerhtml + "</p>"

Should copy a select drop down box, along with it's contents that is defined using SQL, into the new row. But for some reason all i get is the word "undefined". Can anyone help me with this?
 
Back
Top