ashas
09-07-2003, 09:13 PM
Hello,
I have created a Form, within this form there are fields that I would like the user to be able to add more rows to if necessary..
I am trying to use the cloneNode function to do this..
I have found the following code which I think will work....
function addRowSubmit(ordId,drId)
{
alert("You are in addrow func");
theRow=document.getElementById(ordId);
theRow.parentNode.insertBefore(theRow.cloneNode (true),document.getElementById(drId));
}
I am getting an error on the second line of the function, the error reads something like "Error:Object required"
I have no idea what this error means..
My questions are:
1) Does the code above look incorrect?
2) What type of variable does the getElementById() accept?
Hope someone can help!
Thanks,
Asha
I have created a Form, within this form there are fields that I would like the user to be able to add more rows to if necessary..
I am trying to use the cloneNode function to do this..
I have found the following code which I think will work....
function addRowSubmit(ordId,drId)
{
alert("You are in addrow func");
theRow=document.getElementById(ordId);
theRow.parentNode.insertBefore(theRow.cloneNode (true),document.getElementById(drId));
}
I am getting an error on the second line of the function, the error reads something like "Error:Object required"
I have no idea what this error means..
My questions are:
1) Does the code above look incorrect?
2) What type of variable does the getElementById() accept?
Hope someone can help!
Thanks,
Asha