derbystar16 Posted February 23, 2007 Share Posted February 23, 2007 I can't seem to figure this out. I created a dynamic table with 5 columns, the first being a Status column that could be one of two values: OPEN, CLOSED I am using a repeated region to show all records. I want to change the background color of any row where the Status column = 'OPEN' The problem is that since I'm using a repeated region, the table/column/row ID is also repeated so as the data is being read in, IE and Safari only recognize the first table ID. They don't seem to recognize multiple tables with the same ID and I cant seem to reference the other tables listed. Does this make sense to anyone? I'm having a hard time explaining it. Any ideas? Link to comment https://forums.phpfreaks.com/topic/39724-changing-background-color-of-a-row-in-repeated-region/ Share on other sites More sharing options...
jcbarr Posted February 23, 2007 Share Posted February 23, 2007 I think I know what you are talking about. Any row's that status is open should have all cells in that row with a certain color, correct? In your loop have it check the status column first and then input an if statment that will echo the bgcolor if the status is open, and won't if the status is closed. Then echo the rest of the output the way you normally would. Let me see the code, and I might be able to add a few lines to do what you want. Link to comment https://forums.phpfreaks.com/topic/39724-changing-background-color-of-a-row-in-repeated-region/#findComment-191813 Share on other sites More sharing options...
derbystar16 Posted February 23, 2007 Author Share Posted February 23, 2007 <td width="10%" align="center" bordercolor="#FBFBFB" bgcolor="#99CCFF" id="idStatus"><span class="style9"> <?php echo $row_Recordset1['status']; ?> </span> <script> var status = '<?php echo $row_Recordset1['status']; ?>' var element = document.getElementById("idStatus"); if (status == "CLOSED") element.style.backgroundColor = "#000000"; </script> </td> This code works perfectly in FF but not in IE or Safari Link to comment https://forums.phpfreaks.com/topic/39724-changing-background-color-of-a-row-in-repeated-region/#findComment-191827 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.