Jump to content

Search the Community

Showing results for tags 'conditional formatting'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Caspio Bridge
    • Caspio Apps for Ukraine
    • General Questions
    • Caspio JavaScript Solutions
    • Tables, Views and Relationships
    • Import/Export and DataHub
    • DataPages
    • Deployment
    • Security, Authentications, Roles, SAML
    • Styles and Localizations
    • Parameters
    • API and Integration
    • Calculations and aggregations
    • User JavaScript and CSS Discussions

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start




Website URL






Found 2 results

  1. Hello all, I have been putting together a simple pivot table view to display outcomes and percentages of an audit process that we perform which looks something like below; I would like to conditionally format the "% Correct" columns so that they are Green if = 100% or Red if < 100% I have found this a bit difficult as there do not appear to be any Element ID's associated with the cells, I got the result below by using Class Name and column No; Using this code deployed in the footer; <script> function f_color(){ if('[@calcfield:11]' == '100 %') { document.getElementsByClassName('cbResultSetData cbResultSetTableCellNumberDate cbResultSetCalculatedField') [3].style.backgroundColor="green"; document.getElementsByClassName('cbResultSetData cbResultSetTableCellNumberDate cbResultSetCalculatedField') [3].style.color="white"; }else{document.getElementsByClassName('cbResultSetData cbResultSetTableCellNumberDate cbResultSetCalculatedField') [3].style.backgroundColor="red"; document.getElementsByClassName('cbResultSetData cbResultSetTableCellNumberDate cbResultSetCalculatedField') [3].style.color="white"; } } f_color(); </script> However it doesn't switch to green when the field is = 100% (see below I assume this is because the calculated field I am referencing is either the incorrect syntax or can't be used in this way ) and as you can see doesn't apply to all cells in the respective column; Any suggestions or guidance would be gratefully received as I am probably going in completely the wrong direction and I have searched the forums and can find a number of suggestions/solutions for Tabular reports but nothing for Pivot Table reports. Kind regards, Roosta
  2. Hello- I'm trying to apply conditional formatting to a drop-down box in a Submission Form DataPage. For example, when the user selects "Fail" from the drop-down box, I want the background of the box to turn red. Here's the code I tried to use without success. I pasted this into an HTML block directly after the drop-down box. <script> var select = document.getElementById("InsertRecordPrint_Asmt_Rec"); select.onchange = function(){ var selectedString = select.options[select.selectedIndex].value; if (selectedString == "Fail") { document.getElementById("InsertRecordPrint_Asmt_Rec").style.color = "red"; } Else { document.getElementById("InsertRecordPrint_Asmt_Rec).style.color = "black"; }} </script> Any help would be greatly appreciated.
  • Create New...