getting values from a repeating table

J

JR

basically i have two repeating tables. the user will fill in the first one,
and the second one could the be same as the first, but doees not have to be.

Table1 and Table2 are structured like:
-------------------------------
name | extension | dept. |
-------------------------------
where each cell is a text box.

under the second table, i have a button "Same As Above" and if clicked,
every row from the first table should be duplicated into the second table.


if someone could jsut give me a snippet of code to look off of (i.e. how to
identify fields and these dynamic rows) i can work from there. I am new to
JScript but not to coding.

thanks!
 
S

S.Y.M. Wong-A-Ton

Are you looking to copy all the rows from table 1 to table 2? Or do you only
want a selected row in table 1 to be copied to table 2?

The first is quite easy: You need to retrieve the group node of all the rows
in table 1 using a selectSingleNode on the DOM or use a selectNodes to
retrieve all the nodes for the rows, and then loop through all the rows, and
for each row, create a new node with the data of the row, and then use an
appendChild on the group node of table 2 to add each row to table 2.

The second is a bit more challenging. If you are still having problems with
this, let me know. Things are quite busy for me these days, but I could try
to convert your scenario into a recipe/solution on my website.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top