Jump to content

Changing Background Color of a Row in Repeated Region


derbystar16

Recommended Posts

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?

 

 

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.

<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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.