Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE table.moveRow bug?

Status
Not open for further replies.

alpot

Programmer
Mar 8, 2001
8
US
I have a table with two rows.

Each row contains a check box, a text box and two buttons (Up & Down).
The Up and Down buttons move the table rows up and down respectively.
When I click Up and Down on either rows the text in the boxes gets interchanged
but the checkboxes do not maintain its state. Whats up with that?

Happening on IE 6.0.2600.0000


<table id=&quot;taboo&quot;>
<tr id=&quot;r1&quot;>
<td>
<input type=&quot;checkbox&quot;>&nbsp<input type=&quot;text&quot;>
</td>
<td>
<input type=&quot;button&quot; value=&quot;Down&quot; onclick=&quot;down('r1');&quot;>
<input type=&quot;button&quot; value=&quot;Up&quot; onclick=&quot;up('r1');&quot;>
</td>
</tr>
<tr id=&quot;r2&quot;>
<td>
<input type=&quot;checkbox&quot;>&nbsp<input type=&quot;text&quot;>
</td>
<td>
<input type=&quot;button&quot; value=&quot;Down&quot; onclick=&quot;down('r2');&quot;>
<input type=&quot;button&quot; value=&quot;Up&quot; onclick=&quot;up('r2');&quot;>

</td>
</tr>
</table>

<script>
<!--

function up(id) {
var table = document.getElementById(&quot;taboo&quot;);
var panel1 = document.getElementById(id);
curr1 = panel1.sectionRowIndex;
table.moveRow(curr1, curr1-1);

}
function down(id) {
var table = document.getElementById(&quot;taboo&quot;);
var panel1 = document.getElementById(id);
curr1 = panel1.sectionRowIndex;
table.moveRow(curr1, curr1+1);

}

-->

</script>
 
yep...i'm seeing the same behavior. not sure if MS would say it's a bug or by design.

what you could do is store the checkbox's state before moving, then restore that state after moving.

=========================================================
while (!succeed) try();
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top