Michelle Posted May 12, 2016 Report Share Posted May 12, 2016 Hi All! I used a solution from the How-To for changing background, but the script seems doesn't work for me: Code from the html block below all the fields: [@field:Sale_Location_State] <a id="visi[@field:ID]"> <script>var isi = document.getElementByID("visi[@field:ID]");if('[@field:Sales]' >=1000){isi.parentNode.parentNode.style.backgroundColor = 'green';}else{isi.parentNode.parentNode.style.backgroundColor = 'red';}</script> </a> Quote Link to comment Share on other sites More sharing options...
Mathilda Posted May 12, 2016 Report Share Posted May 12, 2016 Hi Michelle, As far as I can see, you use solution from here I don't see code from the first html block/ Please make sure, that you have added the following code to the html block before all the fields: <div id="visi[@field:ID]"> Also I see that you've made a mistake in the syntax: you should use: getElementById instead of getElementByID And there is no closing div tag. I've edited your code: </div> <script>var isi = document.getElementById("visi[@field:ID]");if('[@field:Sales]' >=1000){isi.parentNode.parentNode.style.backgroundColor = 'green';}else{isi.parentNode.parentNode.style.backgroundColor = 'red';}</script> Hope it helps 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.