Jump to content

Prophecy

Members
  • Content Count

    5
  • Joined

  • Last visited

Everything posted by Prophecy

  1. Hi MayMusic, I really appreciate your assistance! I've placed the the block above and below as advised and attempted the JS code myself with no result. Please review my JS and let me know where I've gone wrong? <script> var calcField = [@field:Health_Check_Total_Score#]; if (calcField < 33) { document.getElementById('Section_2').style.display = 'block'; document.getElementById('Section_3').style.display = 'none'; document.getElementById('Section_4').style.display = 'none'; } elseif (calcField < 66) { document.getElementById('Section_2').style.display = 'none'; document.getElementById('Section_3').style.display = 'block'; document.getElementById('Section_4').style.display = 'none'; } elseif (calcField < 100) { document.getElementById('Section_2').style.display = 'none'; document.getElementById('Section_3').style.display = 'none'; document.getElementById('Section_4').style.display = 'block'; } </script>
  2. I have placed a HTML block above and below as recommended and I've tried this code below with no result? if ([@field:Health_Check_Total_Score%] < 33) {<div id="Section_2" } else if ([@field:Health_Check_Total_Score%] < 66) {<div id="Section_3" } else {<div id="Section_4" }
  3. I have placed a HTML block above and below as recommended and I've tried this code below with no result? if ([@field:Health_Check_Total_Score%] < 33) {<div id="Section_2" } else if ([@field:Health_Check_Total_Score%] < 66) {<div id="Section_3" } else {<div id="Section_4" }
  4. https://c0dcr523.caspio.com/dp/daec7000ff004040d11246a2bb11
  5. How do I write the correct JavaScript to deploy dynamic sections within a datapage? I have 3 sections containing a HTML block with different content in each. Based on a calculated field which contains a percentage. I only want to show the relevant section and hide the others Section 1 = % range >0 & < 33 Section 2 = % range >34 & < 66 Section 3 = % range >66 & < 100
×
×
  • Create New...