Skip to main content
Participant
May 14, 2025
Question

Request for Assistance with JavaScript Formatting in PDF Forms

  • May 14, 2025
  • 3 replies
  • 300 views

Dear Adobe Support Team,

I hope this message finds you well. I am reaching out to seek assistance regarding an issue I am experiencing with the JavaScript functionality in Adobe Acrobat while working on a PDF form.I have implemented a JavaScript code to dynamically format form fields based on their values. Specifically, I want the fields to display a light red background with dark red text when the values are below 1.0 or above 1.6. Conversely, for values within the range of 1.0 to 1.6, I would like the background to be white with black text.
Current Implementation:
I have added the JavaScript code to the text fields. However, I am encountering the following issues:

    • When I click out of the field, the text color changes to white, and the background remains blue instead of displaying the specified dark red text on a light red background.

       

    • The formatting does not persist after the field loses focus.

Request for Assistance:
I would greatly appreciate your guidance on how to resolve this issue so that the desired colors are applied and maintained correctly after the user clicks outside the field. If there are alternative methods or specific settings that I should be aware of to achieve this functionality, please let me know.Thank you for your attention to this matter. I look forward to your prompt response.

Br,
Naitik

3 replies

PDF Automation Station
Community Expert
Community Expert
May 14, 2025

You will find the reason and the solution here:

https://pdfautomationstation.substack.com/p/form-field-color-issues

 

try67
Community Expert
Community Expert
May 14, 2025

You must disable the fields highlighting feature of the application to see the fill color you've applied.

Bernd Alheit
Community Expert
Community Expert
May 14, 2025

What script do you use?