I am trying to create a function to add rows dynamically to a table. 2 rows need to be added to the table each time.
The first row has a check box which determines is the second row is visible or not. I am creating the other rows when the data is first loaded using ASP and the javascript function works great to show or hide the table rows.
Each row is created with an id which is passed to the function. In ASP, I can create table rows with ID no problem. In javascript it get an error.
Here is the line of code that creates the row:
currentRow = document.createElement("TR");
currentRow.setAttibute("id", "rowOrgName");
When the function runs, the setAttributes line generates the error "object does not support this property or method".
I am at a loss. I am new to javascript. I am also using the style/display tag to show or hide a table row. Is there a better way?
Thanks
Denis
Programmer, Canada
The first row has a check box which determines is the second row is visible or not. I am creating the other rows when the data is first loaded using ASP and the javascript function works great to show or hide the table rows.
Each row is created with an id which is passed to the function. In ASP, I can create table rows with ID no problem. In javascript it get an error.
Here is the line of code that creates the row:
currentRow = document.createElement("TR");
currentRow.setAttibute("id", "rowOrgName");
When the function runs, the setAttributes line generates the error "object does not support this property or method".
I am at a loss. I am new to javascript. I am also using the style/display tag to show or hide a table row. Is there a better way?
Thanks
Denis
Programmer, Canada