/ Id-Extras Forum / How to highlight the active field with a thicker line (FormMaker, Acrobat)

  • Author
  • #7701 Reply
    Ariel
    Keymaster

      I was asked if it is possible to highlight the active field in an interactive PDF, using FormMaker.

      The answer is yes. Many ways of doing this, but the basic idea is to create an “on focus” event and “on blur” event. The “on Focus” event will run a Javascript to make the line thicker, and the “on blur” event will have another Javascript to make the line thinner again.

      The “on Focus” event script would be the following 2 lines. (I’m setting the colour of the stroke in the script to black. In fact, it would be better to do this by simply setting the stroke colour of the field in FormMaker in the usual way.)

      event.target.lineWidth = 3;
      event.target.strokeColor = color.black;

      And the “on Blur” script is basically the same, just changing the line width back to 1:

      event.target.lineWidth = 1;
      event.target.strokeColor = color.black;

      Each form field should be selected in turn in FormMaker, and these scripts should be added via the Actions tab:

       

    Viewing 1 post (of 1 total)

    Tagged: 

    Reply To: How to highlight the active field with a thicker line (FormMaker, Acrobat)
    Your information: