2 Replies Latest reply on Jan 22, 2009 11:03 AM by Jim MacD

    Display A Hiden Form Field On Executing A Button

    Jim MacD Level 1
      Hi,

      I'm looking for code within a JavaScript that will enable a hidden form field within a PDF to be displayed.

      i.e. The status of 'Text1' is hidden, but when 'Button1' is pressed, the status of 'Text1' is changed to visible.

      I'm using Adobe pro 8.

      Thanks
        • 1. Re: Display A Hiden Form Field On Executing A Button
          George_Johnson MVP & Adobe Community Professional
          Do you want the button to toggle the display of the text field, or simply make it not hidden? If so, the Mouse Up code of the button might look like:


          (function () {

              var f = getField("Text1");
              f.display = (f.display === display.hidden) ? display.visible : display.hidden;

          })();


          Otherwise, to display a hidden field:


          getField("Text1").display = display.visible;


          where you'd replace "Text1" in the code above with the actual name of your text field.

          George
          • 2. Re: Display A Hiden Form Field On Executing A Button
            Jim MacD Level 1
            Thanks, George:

            Guess I should have been more specific. What I want to do, is display 'Text1" when the button is pushed executing a check of the system date.

            ie

            If the system date is equal to or greater then '2009/02/01' (yyyy,mm,dd), then display 'Text1'.