Q
Question Boy
I have a table which has rows setup as shown below, where the number
between [] gets incremented row by row.
<tr>
<td><input name="Item_Id[0]" type="text" value="23" readonly="true"
tabindex="0" /></td>
<td><input name="Item[0]" type="text" value="Database Support" /></
td>
<td>$<input name="Cost[0]" type="text" value="85.00" /></td>
<td><input name="Sort_Order[0]" type="text" value="1"/><img
src="images/element_down.png" width="16px" height="16px"
onclick="move(this,'down');" /><img src="images/element_up.png"
width="16px" height="16px" onclick="move(this,'up');" /></td>
</tr>
I need to build a script that will loop through the row in the table a
renumber the value found in the Sort_Order[] input to match the row
number (1,2,3,...).
I started digging and found that I could use something like:
var loTable=document.getElementById("pricing");
for(var liCount=1;liCount<loTable.rows.length-1;liCount++){
}
but do not know how to continue the code to change the value of that
specific input.
I thank you in advance for your help and guidance,
QB
between [] gets incremented row by row.
<tr>
<td><input name="Item_Id[0]" type="text" value="23" readonly="true"
tabindex="0" /></td>
<td><input name="Item[0]" type="text" value="Database Support" /></
td>
<td>$<input name="Cost[0]" type="text" value="85.00" /></td>
<td><input name="Sort_Order[0]" type="text" value="1"/><img
src="images/element_down.png" width="16px" height="16px"
onclick="move(this,'down');" /><img src="images/element_up.png"
width="16px" height="16px" onclick="move(this,'up');" /></td>
</tr>
I need to build a script that will loop through the row in the table a
renumber the value found in the Sort_Order[] input to match the row
number (1,2,3,...).
I started digging and found that I could use something like:
var loTable=document.getElementById("pricing");
for(var liCount=1;liCount<loTable.rows.length-1;liCount++){
}
but do not know how to continue the code to change the value of that
specific input.
I thank you in advance for your help and guidance,
QB