Changing the background colors of fillable areas (Examples of Common Scripting Tasks) | Community
Skip to main content
New Participant
December 12, 2023

Changing the background colors of fillable areas (Examples of Common Scripting Tasks)

  • December 12, 2023
  • 1 reply
  • 860 views

I am trying to change the color of the fillable areas of the text field as suggested in this example of the Adobe.

 

So I created one text field, and a button. Later I used the below code in the click option of the button

xfa.resolveNode("subform_1.TextField1.ui.#textEdit.border.fill.color").value = "153,204,255";

I wrote the same code (except the path address of the object), but after clicking the button the fillable areas are not changing. I attached the PDF with question for your reference.

 

Can anyone tell me why color is not changing? 

 

Thank you so much for your time, and suggestions.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

New Participant
December 12, 2023

There are two things:

 

1. Change your code to this:

form1.subform_1.TextField1.ui.oneOfChild.border.fill.color.value = "153,204,255";

That will avoid a resolveNode.

2. You need to uncheck the "Show border hover color for fields" in Preferences/Forms in Acrobat or Reader, which ever you are using for Preview PDF.

 

New Participant
December 12, 2023

@koolforms thanks for your answer. But, I am curious why need to change the code, while I am trying to use the official example?

 

In addition, I can change the Preferences but isn't it bad for user (I mean not a user friendly)?