i have a group of dynamically created textfields tagged by an "id=idesc", and another group of dynamically created textfields tagged by an "id=ipno". what i need to do is loop through the number of created textfields (numItems) and store the results in an array. I'd like to have each array element to consist of a desc and a pno so the array would look like this: array[0] = desc1, pno1 array[1] - desc2, pno2 array[2] - desc3, pno3 array[3] - desc4, pno4 . . . array[n] - descn, pnon Could someone tell me how to fix this code: function submitSave() { var i; var iarray = new Array(); var iDescriptionValue = new Array(); var iPartnoValue = new Array(); for (i=0; i<numItems; i++) { document.getElementById("idesc") = iDescriptionValue; document.getElementById("ipno") = iPartnoValue; iarray[i] = array(iDescriptionValue, iPartnoValue); alert(iarray); } } Code (markup):