I am trying to read values from a form dynamically created by user and insert them in an 2 dimensional array. The ID of any field is created dynamically and it has the value 11, 12, 13 etc, depending on the rows and cols of the table. I try to read it using getElementByID but it seems to not work. The function is as follows:
function readMatrix () {
for (i = 0; i < k; i++) {
for (j = 0; j < k; j++)
A[i][j]=parseFloat(getElementById(ij).value, 10);
}
}
iandj. Usevarto avoid this!! AndparseFloatdoes not have a 2ndbaseargument. Unless you are using HTML5 you also cannot have an ID starting with a number.