ssantos
10-02-2008, 11:19 PM
Hi - I am trying to clone a row in a table. This row contains a form field which could be a text field or a drop-down box. That field could contain a value. What I would like to do is clone the row (since it has a description of the field) - but blank out the data if it exists.
Here is the code I have so far:
var myTable= myBody.getElementsByTagName("TABLE").item(0);
var myTR = myTable.getElementsByTagName("TR").item(1);
var myNewTR = myTR.cloneNode(true);
Within the myTR is a field called "someval". What is the best way to access this field to set its value to blank - taking into account that sometimes this field is of input type = text or it could be a drop-down box? Would I have to access it via childNodes?
Thanks in advance for your help!
Here is the code I have so far:
var myTable= myBody.getElementsByTagName("TABLE").item(0);
var myTR = myTable.getElementsByTagName("TR").item(1);
var myNewTR = myTR.cloneNode(true);
Within the myTR is a field called "someval". What is the best way to access this field to set its value to blank - taking into account that sometimes this field is of input type = text or it could be a drop-down box? Would I have to access it via childNodes?
Thanks in advance for your help!