0 Replies Latest reply on Mar 19, 2008 9:36 AM by (Brad_Steeg)

    Highlight Fields when PDF is opened - LiveCycle 8

    Level 1
      LiveCycle 8
      Win XP

      Hi,

      I'm trying to automatically highlight the form fields on a PDF when it is opened. I want the form to act as though the user has chosen the "Highlight Fields" option/button.

      I would prefer a javascript function to fire (on itialize?) so I don't have to attach code to every field and possibly allow me to easily use it on future PDFs.

      My current thoughts are to loop through all fields on the form and set the fillColor property to a light blue "221,228,255". Here's the javascript I'm currently trying to use:

      for (var i=0; i < xfa.host.numPages; i++){

      ]var oFields = xfa.layout.pageContent(i,"fields");

      ]var nodesLength = oFields.length;

      ]for (var j=0; j< nodesLength; j++){

      ]]var oItem = oFields.item(j);

      ]]oItem.fillColor = "221,228,255";

      ]}

      }

      Unfortunately, I can't seem to get it to work. Also, I'm not sure where to put it once it does work so that it fires when the PDF is opened.

      Thanks for any help.