Jump to content
  • 0

Change Datapage Row in Different color based on condition


Vipul

Question

Hello,

I want to highlight any record is older then 1 day in Red Color based on my timestamp field... so can some one correct this script ?

<a id="visi[@field:Ticketid]"> <script>
var isi = document.getElementById("visi[@field:Ticketid]");
if(''!=='0'){
isi.parentNode.parentNode.style.backgroundColor = '#FF9999';
}
else{
isi.parentNode.parentNode.style.backgroundColor = '#FFFFFF';
}
</script></a>

 

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi @Vipul,

The following condition is set in the wrong way in your code:

if(''!=='0')

You need to specify the field name which you would like to compare with '0':

if('[@FieldName]' == '0')

You can find a detailed guide in this article:

https://howto.caspio.com/tech-tips-and-articles/advanced-customizations/how-to-dynamically-change-the-background-of-a-results-page/

Regards,

vitalikssssss

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...