Copy link to clipboard
Copied
Hi Community,
I would like to highlight red the 'Dew Point' field when the value is 3 or more below the 'Steel Surface Temp' field. (ie Steel Surface = 40, Dew = 37, field = red).
Have managed to highlight red another field based on a value range, but am having trouble highlighting based of other fields.
Feel free to throw in any tips to help my understanding 🙂
Cheers!
Copy link to clipboard
Copied
Hi JR, I think he's looking for the difference between the two values. Here's a modification of the scirpt
if ((this.getField("Steel Surface Temp").value-event.value) >= 3) {event.target.fillColor = color.red;}
else {event.target.fillColor = color.transparent;}
Copy link to clipboard
Copied
Use this as a Calculation script in the Dew Point field:
if (this.getField("Steel Surface Temp").value >= 3) {event.target.fillColor = color.red;}
else {event.target.fillColor = color.transparent;}
Copy link to clipboard
Copied
Thanks JR!
Copy link to clipboard
Copied
Hi JR, I think he's looking for the difference between the two values. Here's a modification of the scirpt
if ((this.getField("Steel Surface Temp").value-event.value) >= 3) {event.target.fillColor = color.red;}
else {event.target.fillColor = color.transparent;}
Copy link to clipboard
Copied
Works like a charm, thanks Thom.
Copy link to clipboard
Copied
Thom, how do I adjust the script to fillcolor red if 3 above OR below the "Steel Surface Temp"
Thank you!
Copy link to clipboard
Copied
Use the Absolute value of the difference for the comparison.
if (Math.abs(this.getField("Steel Surface Temp").value - event.value) >= 3)
{event.target.fillColor = color.red;}
else {event.target.fillColor = color.transparent;}
Copy link to clipboard
Copied
thanks again Thom
Copy link to clipboard
Copied
I still need to improve my understanding of English
😉
Copy link to clipboard
Copied
You are doing great!!
Copy link to clipboard
Copied
Thom, just have to say your tutorials on pdf scripting dot com have been a great help to my current form projects.
Copy link to clipboard
Copied
Thom's tools and tutorials are in first place in my list of PDF & JavaScript resources, even for French speakers.
🙂
Find more inspiration, events, and resources on the new Adobe Community
Explore Now