gcGERM16 Posted January 21, 2016 Report Share Posted January 21, 2016 Hi all, I'm quite new to Caspio and to digital stuff so please bare with me. I'm currently using the code below to format the 7th column of my table red, amber of green depending on the value in each cell. <SCRIPT LANGUAGE="JavaScript"> var elems = document.getElementsByTagName("td");for (var i=0, m=elems.length; i<m; i++) { if (elems[i].innerHTML=="Low") { elems[i].style.color="red";} if (elems[i].innerHTML=="Low") {elems[i].style.backgroundColor="lightpink"} if (elems[i].innerHTML=="Mid") { elems[i].style.color="orange";} if (elems[i].innerHTML=="Mid") {elems[i].style.backgroundColor="wheat"} if (elems[i].innerHTML=="High") { elems[i].style.color="green";} if (elems[i].innerHTML=="High") {elems[i].style.backgroundColor="LightGreen"}} </SCRIPT> However, whenever I sort the table results by clicking the column headings or try to move onto the next page of results (by using the arrow buttons at the bottom of the page) all of the formatting generated by the code above disappears. Currently this code is located in the footer. Does anyone know how to prevent this from happening? Quote Link to comment Share on other sites More sharing options...
GoCubbies Posted January 21, 2016 Report Share Posted January 21, 2016 Hello, I would recommend disabling AJAX on the Results Page Options of the DataPage Wizard. Quote Link to comment Share on other sites More sharing options...
gcGERM16 Posted January 25, 2016 Author Report Share Posted January 25, 2016 Many thanks, this solved the problem! 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.