Expand my Community achievements bar.

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

Avatar

Level 3

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.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

2 Replies

Avatar

Level 3

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.

koolForms_0-1702404830747.png

 

Avatar

Level 3

@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)?