Can a calculated cell in a PDF form use 'conditional formatting' to change colors?

I have a form that adds entries from 7 cells to calculate a sum. I need to see if it is possible to specify 'conditional formatting' so the cell containing the total will change to a specified color (three colors max) based on where the number falls within a specified range. I am using Acrobat XI Pro.


Kathey Freeman


3 Answers

Voted Best Answer

This code will change the field's fill color. If you want to change the text color as well you'll need to provide more details:

var v = Number(event.value);
if (v>=0 && v<=26) {event.target.fillColor = color.green;}
else if (v>26 && v<=50) {event.target.fillColor = color.yellow;}
else if (v>50 && v<=60) {event.target.fillColor = color.red;}
else event.target.fillColor = color.white;

It should be placed as the field's custom Validation script, by the way.

.


Visit my custom-made PDF scripts website: http://try67.blogspot.com
Contact me personally: try6767@gmail.com


By Gilad D (try67)   

Yes, it's possible. What ranges and what formatting settings do you want to use, exactly?

.


Visit my custom-made PDF scripts website: http://try67.blogspot.com
Contact me personally: try6767@gmail.com


Gilad D (try67)   

Take a look at this tutorial, it shows how to change the color of a field in a custom validation script:

http://acrobatusers.com/tutorials/using-colors-acrobat-javascript


Karl Heinz Kremer   


Please specify a reason: