ChrisCarlson Posted February 1, 2019 Report Share Posted February 1, 2019 Hello, I am using the following solution to conditionally highlight a calendar datapage. https://howto.caspio.com/tech-tips-and-articles/advanced-customizations/how-to-dynamically-change-the-background-of-a-results-page/ I would like to modify this script so that I can highlight only the actual calendar day number and not the calendar day block. I am already highlighting the actual calendar day with this script below. I need to highlight the actual calendar day based on certain condition (like end of fiscal month). Does anyone know how I can modify to text-highlight in color the calendar day? <script> if('[@Yes/No FieldName]' == 'No'){ var isi = document.getElementById("visi[@field:UniqueFieldName]"); isi.style.display = 'none'; isi.parentNode.parentNode.style.backgroundImage = 'url("ImageURL")'; } </script> Quote Link to comment Share on other sites More sharing options...
George43 Posted February 1, 2019 Report Share Posted February 1, 2019 In order to do this you can just use this simple snippet of code. document.getElementsByClassName("cbResultSetCalendarField")[x].style.backgroundColor="blue"; Where x is Number of Day of the monthe starting from 0 Quote Link to comment Share on other sites More sharing options...
ChrisCarlson Posted February 1, 2019 Author Report Share Posted February 1, 2019 George, Is there a way to modify this line below, so that it automatically points to that calendar day number? The line below automatically points to the calendar block, so I was hoping I could achieve similar without having to declare the calendar day #. isi.parentNode.parentNode.style.backgroundColor = '#FFFF99'; Here is my script: <script> if('[@calcfield:1]' == 'Over / Uncorrected'){ var isi = document.getElementById("visi[@field:record_id]"); isi.parentNode.parentNode.style.backgroundColor = '#FFFF99'; } else if('[@calcfield:1]' == 'Short / Uncorrected'){ var isi = document.getElementById("visi[@field:record_id]"); isi.parentNode.parentNode.style.backgroundColor = '#FFFF99'; } else if('[@calcfield:1]' == 'Not Completed'){ var isi = document.getElementById("visi[@field:record_id]"); isi.parentNode.parentNode.style.backgroundColor = '#B0C4DE'; } else if('[@calcfield:1]' == 'Past Due'){ var isi = document.getElementById("visi[@field:record_id]"); isi.parentNode.parentNode.style.backgroundColor = '#D8BFD8'; } </script> Quote Link to comment Share on other sites More sharing options...
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.