Creating Javascript to conditionally format a fillable form field
Hi - I've created a PDF Form with Acrobat. I'm automatically filling the form fields with data from a SmartSheet. I have some fields that I need to change the background fill color of depending on the content of the field, once filled. For instance, if the field value is "Green", I would want to change the background fill color of the field to Green, etc.
Would this be a Custom Format Script? It seems like it would be.
Can someone provide some assistance on what this code would look like? This is my first crack at using Javascript in Acrobat, so a bit lost. Here is my first attempt:
var status = this.getField("Risk/Issue 1 - Status Color");
if (status.value = "Green")
status.fillColor = color.green
But that results in the following error:
InvalidSetError: Set not possible, invalid or unknown.
Field.value:2:Field Risk/Issue 1 - Status Color:Format
I seem to be stuck at the starting gate. Any assistance is appreciated.
Tony
