The textfields are created in a loop that are named incrementally, description textfield and a part number textfield, as such:
descriptionTextfield1 partnumberTextfield1
descriptionTextfield2 partnumberTextfield2
descriptionTextfield3 partnumberTextfield3
descriptionTextfield4 partnumberTextfield4
descriptionTextfield5 partnumberTextfield5
descriptionTextfield6 partnumberTextfield6
.
.
.
descriptionTextfieldn partnumberTextfieldn
Is this code below correct...in that the textfields name will be referred to as textfield1, textfield2, etc..?
Code: Select all
document.getElementById("textfields").innerHTML += 'Item '+numItems+' Description<INPUT TYPE="text" NAME="idescription '+numItems+'" >
Part Number <INPUT TYPE="text" NAME="ipartno '+numItems+'" VALUE="" ONKEYDOWN="if (event.keyCode==9) { addNewItem(); }">';Please let me know if this would work correctly and how i would go about it.
Thanks in advance.