2 Replies Latest reply on Jun 7, 2011 8:56 PM by Collij3

    Button Scripting

    Collij3 Level 1

      I'm using Acrobat X Pro and I'm trying to edit a pdf document.

       

      I am using a button and when I click on the button I want it to display a X with yellow color fill in a text field below it. When I click on the button again I want the text field to be completely blank.

       

      So far, when I click on the button I can get it to display the "X" and the yellow color fill but when I click it again it only changes the text to "Off" and keeps the yellow color fill. How do I make it completely blank on every other button press?

       

      The code I have so far for the button is as follows:

       

      toggleButton("textfield", "X");

      var f = this.getField("textfield");

      f.fillColor = color.yellow;

       

      Thank you.