Skip to main content
Participant
July 13, 2024
Answered

Changing border color of a separate text field

  • July 13, 2024
  • 1 reply
  • 922 views

I need to change the border color of a text field from black to red based on information from two other text fields.  Let's say I have X and Y.  X is the field on which we want to change the border color based on the Y value.  But this Javascript needs to be added to the Custom Calculation Script of Y.

 

If X is greater than 1 and Y is greater than X, then change the border color of X to red else black.

 

How can I do this?

This topic has been closed for replies.
Correct answer PDF Automation Station

Enter the following custom calculation script in Y:

 

if(this.getField("X").value>1 && event.value>this.getField("X").value)
{
this.getField("X").borderColor=color.red
}
else
{
this.getField("X").borderColor=color.black
}

1 reply

PDF Automation Station
Community Expert
Community Expert
July 13, 2024

Enter the following custom calculation script in Y:

 

if(this.getField("X").value>1 && event.value>this.getField("X").value)
{
this.getField("X").borderColor=color.red
}
else
{
this.getField("X").borderColor=color.black
}

try67
Community Expert
Community Expert
July 14, 2024

The borderColor property is deprecated. You should use strokeColor, instead.