January 16, 200620 yr Hi, This may be a calculation rather that a script requirement? Basically I need to change either the background colour or the text colour based upon a choice of Yes or No. So if a field = "Yes" then I want to change the background to say red(or the text) and if the field = "No" then I want to have the field change to say Green! I thought of having a container with a graphic colour saying yes and a graphic colour saying no and setting the field with the necessary colour but I need to use the words Yes or No and I can't do this using a container. I need to "Get Graphic Colour" somehow? Can anyone help?
January 16, 200620 yr Create a calculation whose output type is Container (down in the lower left of the Define Calculation): Case(myfield= "Yes", backgroundfield, "") Put background file behind the input field, same size. The calc field should be set to not allow entry. You can put whatever color you want into the backgroundfield. Steve
January 16, 200620 yr If the background need only cover a few lines, you can use this method without container fields. Just have the calculation field with a formula similar to this: Let( a ="llllllllllllllllllllllllllllllllllllllll" ; Case(field="YES"; TextColor( a ;RGB( 200;0 ;0)) ; TextColor( a ;RGB( 0;200 ;0)) ) ) Those are lower case l's, bold, sized, sans serif - duplicate the field to cover the gaps. The group of l's can have returns in the formula to cover more verticle area. Also, in your case, in lieu of l's, you could use the words YES and NO. The advantage here is flexibility. You can easily add, or change, a rainbow of meaning in seconds without adding or changing container fields. A Left function can even determine the width of the highlight. David
Create an account or sign in to comment