Jump to content
Sign in to follow this  
senicholas

Conditional Background Color Change

Recommended Posts

Hello Senicholas, 

Try to implement it this way:

<script>
function f_color(){
var myVal = parseInt(document.getElementById('ID').value);
if (myVal > 7) {
document.getElementById('ID').style.color = "red";
}
}
document.getElementById('ID').onchange= f_color;
</script>

Share this post


Link to post
Share on other sites

Hi senicholas,

If you use a Report DataPage, I hope the following JavaScript can help:

<SCRIPT LANGUAGE="JavaScript">
var elems = document.getElementsByTagName("td");
for (var i=0, m=elems.length; i<m; i++) {
if (elems[i].innerHTML>7)
  { elems[i].style.color="red";}
}
</SCRIPT>

The code checks all valaues and make the color "red", if the value is more than 7.

Share this post


Link to post
Share on other sites

Hi Jan

How can I compare two currency fields - set the Display Only on a Report Details Page -

and if the Invoiced value is higher than the Budget value,  color the  text of Invoiced  value red and its background yellow?

 

Thanks for your help

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...