asp table with javascript getelementbyid
-
I have little problem. I am trying to get id of cell and put value in this cell with this js function:
function fill_table(grid){ var str=grid.toString(); str=str.replace(/\n/g," "); var ar_grid=str.split(" "); var c=0; for(var i = 0; i < 81; i++) { c=i+1; ar_grid[i]=ar_grid[i].replace(/0/gi,""); document.getElementById('cell_'+c).value=ar_grid[i]; } }
This works fine with html table but how to do this with asp table. I addded ID to each cell like this:TableCell c=new TableCell(); c.Attributes["ID"]= "cell_" + st;
-
I have little problem. I am trying to get id of cell and put value in this cell with this js function:
function fill_table(grid){ var str=grid.toString(); str=str.replace(/\n/g," "); var ar_grid=str.split(" "); var c=0; for(var i = 0; i < 81; i++) { c=i+1; ar_grid[i]=ar_grid[i].replace(/0/gi,""); document.getElementById('cell_'+c).value=ar_grid[i]; } }
This works fine with html table but how to do this with asp table. I addded ID to each cell like this:TableCell c=new TableCell(); c.Attributes["ID"]= "cell_" + st;
Aljaz111 wrote:
c.Attributes["ID"]= "cell_" + st;
Why doing this? Why not...
c.ID = "cell_" + st;
-
I have little problem. I am trying to get id of cell and put value in this cell with this js function:
function fill_table(grid){ var str=grid.toString(); str=str.replace(/\n/g," "); var ar_grid=str.split(" "); var c=0; for(var i = 0; i < 81; i++) { c=i+1; ar_grid[i]=ar_grid[i].replace(/0/gi,""); document.getElementById('cell_'+c).value=ar_grid[i]; } }
This works fine with html table but how to do this with asp table. I addded ID to each cell like this:TableCell c=new TableCell(); c.Attributes["ID"]= "cell_" + st;
for set ID by asp table, you use as below TableCell c=new TableCell(); c.ID = "cell_" + st; Thanks, Amit
With Regards, Amit Patel 91-9328488961 India
-
for set ID by asp table, you use as below TableCell c=new TableCell(); c.ID = "cell_" + st; Thanks, Amit
With Regards, Amit Patel 91-9328488961 India