Vipul Posted June 20, 2018 Report Share Posted June 20, 2018 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> Quote Link to comment Share on other sites More sharing options...
0 Vitalikssssss Posted June 27, 2018 Report Share Posted June 27, 2018 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 Quote Link to comment Share on other sites More sharing options...
Question
Vipul
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
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.