1 Reply Latest reply on Nov 30, 2015 9:20 PM by George_Johnson

    How do you change the background colour of a text field in an Acrobat Form from the default blue to white when a value has been entered?

    philipg95855615

      I need my PDF Form to look pretty when the user has finished filling all the text fields (white background not the default blue) Is there a javascript that can do this?

        • 1. Re: How do you change the background colour of a text field in an Acrobat Form from the default blue to white when a value has been entered?
          George_Johnson MVP & Adobe Community Professional

          The blue default is due to the user having field highlighting active. It's possible to turn this off via JavaScript so the setting for the field is shown instead.

          The problem is it's considered bad form to alter a user's preference setting without letting them know or at least attempting to restore the settings when the controlling document closed.

           

          Here is some code you can use in a document-level routine that executes when the document is opened:

           

          // Store the runtime highlight setting so it can be restored when this document is closed

          // and set our own values

          var bRTH = app.runtimeHighlight;

          // Turn off field highlighting

          app.runtimeHighlight = false;

           

           

          Then, in the DocumentWillClose event, you can restore these setting to their original ones:

           

          app.runtimeHighlight = bRTH;