advertisement

Article:
  Dynamic HTML Tables: Improving Performance
Subject:   How to change the element names after a new element is inserted in between the cells.
Date:   2005-06-23 15:21:38
From:   dannyg1
Response to: How to change the element names after a new element is inserted in between the cells.

Your approach depends on the other element in the table, but the first goal is to obtain references to all text box elements in the table. If the form begins and ends within the table, then you can use the document.formName.elements[] array to obtain an array of all elements, and then, as you loop through the elements array, modify the name properties of those elements whose type property is "text".


A more modern (DOM) approach is to use getElementsByTagName("INPUT") of the table element, and then loop through that array, also changing the name properties of those elements whose type property is "text".