PDA

View Full Version : Problem hiding/showing table rows in NS6


spc
03-27-2003, 01:27 PM
I'm hiding and showing table rows using the following....

tbod.rows.item(nIndex).style.display = "none";

and,

tbod.rows.item(nIndex).style.display = "block";

This is working fine, but in NS6, when a row re-appears the value within a text box (which is part of the row) has reset itself.

i.e. If I alter the value in the text box, hide the row, and then show it again, the value has reset itself to the value before I did the initial alteration. I've put in an alert, and after 'display' is set to 'none', the text box value is blank.

Is this a bug with NS6, or am I doing something wrong?

jkd
03-27-2003, 06:14 PM
You should set the display back to "table-row", not "block". Might not fix the problem, but for the sake of correctness you should do it.

liorean
03-27-2003, 06:33 PM
If you switch between 'none' and '' instead, you'll get a result more like what you want. Table elements have their display types, like lists have, and if you use the general 'block' or 'inline' you convert them into a type of display that isn't right you'll break the tables (if the browser allows it). Problem is, most browsers doesn't see this distinction that moz does.

List of values it can take: inline | block | list-item | run-in | compact | marker | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | none | inherit

spc
03-28-2003, 12:40 PM
Thanks for your replies. I tried what you both said; the row still hides/shows correctly, but the textbox still has the same problem.

I altered my code to just hide/show the textbox rather than the whole row, but it still kept resetting the value in the textbox. I guess this is a bug in NS6.