i have a page where i use the function below to add rows to a table…
var gRowId = 1;
var counterRow=0;
var matterIdArray = new Array();
function addRow(){
//alert(gRowId);
//gRowId++;
//if((gRowId !=1)||((gRowId>=2)&&(document.getElementsByTagName(“matterId”).value==null))){
// alert(“Please enter the matterId for the row added and then click on add row”);
//}else{
//counterRow++;
var tbody = document.getElementById(“table1”).getElementsByTagName(“tbody”)[0];
var row = document.createElement(“TR”);
var cell1 = document.createElement(“TD”);
cell1.innerHTML = “MatterID”;
//cell1.innerHTML = gRowId;
var cell2 = document.createElement(“TD”);
var inp1 = document.createElement(“INPUT”);
inp1.setAttribute(“type”,”text”);
inp1.setAttribute(“value”,””);
inp1.setAttribute(“size”,”90″);
inp1.setAttribute(‘id’,’matterId[‘+gRowId+’]’);
cell2.appendChild(inp1);
var cell5 = document.createElement(‘TD’);
var inp4 = document.createElement(‘INPUT’);
inp4.setAttribute(‘type’,’button’);
inp4.setAttribute(‘value’,’Delete’);
inp4.onclick=function(){deleteRow(this);}
cell5.appendChild(inp4);
row.appendChild(cell1);
row.appendChild(cell2);
row.appendChild(cell5);
tbody.appendChild(row);
//alert(row.innerHTML);
gRowId++;
cell1 = null;
cell2 = null;
cell3 = null;
cell4 = null;
row = null;
newRow = null;
tbody = null;
// }
}
Now, I want to store all the values that the user has entered in the text boxes to a javascript array – how do i do this …
thankyou