I have a table generated by asp.net that issues ID's such as: "dgOrders__ctl2_txtqty" for one column of textboxes (user input). What I am trying to do is to collect two columns within the table to pass as Querystring variables.
The table is manipulated on the Client side by either changing the value in the textbox and/or deleting one or more of the rows. The problem is I cannot use the ID to collect the data in the two columns because the chronological order of the ID's change after a deletion event. One of the columns is easily collected by using the innerText approach:
Collecting the textbox values in rows.cells[5] by referring to its ID is hindered because of rows deleted by the Client.
Textbox names behave as follows:
dgOrders__ctl2_txtqty
dgOrders__ctl3_txtqty
dgOrders__ctl4_txtqty
dgOrders__ctl5_txtqty
dgOrders__ctl6_txtqty
..after Client deletion:
dgOrders__ctl2_txtqty
dgOrders__ctl4_txtqty
dgOrders__ctl6_txtqty
I have tried searching here for a simple routine to re-name the rows but no luck. Also, I have had problems trying to use the "getElementsbyID" approach because there are two input objects in each row (a button and the requisite textbox).
Appreciate any guidance here - thanks in advance..
The table is manipulated on the Client side by either changing the value in the textbox and/or deleting one or more of the rows. The problem is I cannot use the ID to collect the data in the two columns because the chronological order of the ID's change after a deletion event. One of the columns is easily collected by using the innerText approach:
Code:
...
var invtable = document.getElementById('dgOrders');
for (var i=0;i<invtable.rows.length-1;i++){
var strpde = invtable.rows[i].cells[1].innerText;
...
Collecting the textbox values in rows.cells[5] by referring to its ID is hindered because of rows deleted by the Client.
Textbox names behave as follows:
dgOrders__ctl2_txtqty
dgOrders__ctl3_txtqty
dgOrders__ctl4_txtqty
dgOrders__ctl5_txtqty
dgOrders__ctl6_txtqty
..after Client deletion:
dgOrders__ctl2_txtqty
dgOrders__ctl4_txtqty
dgOrders__ctl6_txtqty
I have tried searching here for a simple routine to re-name the rows but no luck. Also, I have had problems trying to use the "getElementsbyID" approach because there are two input objects in each row (a button and the requisite textbox).
Appreciate any guidance here - thanks in advance..