Jump to content

Dynamic Table in Repeated Region - Same ID's for all shown REcords


Recommended Posts

Hi I need to know how to change the background color of any particular row within a dynamic region.

 

I have a table pulling in data from a MYSQL DB and it's repeating to show all records. But I do not know how to reference any particular record within that repeated region since the ID's will all be the same.

 

Any ideas?

Why are you giving them the same ID?  You should give them each a unique name instead.

 

And then if you want to change the background color, you can use javascript to do such.

 

How exactly are you wanting the background change to execute? onMouseOver? onClick? etc..

cmgmyr,

 

I dont want to alternate the colors of the rows in a pattern (ie. black white black white etc)

 

This is a dynamic table. If a column has a certain value, I want to change that rows color.

 

I just cant seem to figure out how to do it. I can get it to work in FF but not in IE and Safari and I Think it has something to do with the ID. Since I'm repeating the table, the ID stays the same for each record occurance.

<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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.