2 Replies Latest reply on Dec 26, 2008 6:34 PM by (Kevin_Pillsbury)

    Button Setting Variable - Text Field Not Updating


      I am working with Acrobat 9 Pro on Windows.

      I am unable to make the following work: When the user clicks a Button, a Text Field appears with the text associated with the Button clicked. I have tried accomplishing this with a variable declared in the Document JavaScripts, buttons setting the value of the variable, and a Text Field containing a Custom Calculation Script that returns the text associated with the value of the variable.

      Everything works - except the Text Field doesn't return the text associated with the value of the variable. I have an app.alert (for now) in the button scripts so I can see if the variable has the correct value - and it does - but when the Text Field appears - the text never changes.

      What I have observed: if I go back into the Custom Calculation Script of the Text Field and do nothing, go back out, go to Preview, and click on a Button, the text updates to the previous variable value (not the Button variable value I just clicked).

      So - I think - the Custom Calculation Script isn't seeing the new variable "on the fly". Even though the app.alerts are. I don't think this is a Field Calculation Order problem. But maybe it is. And this is where my brain power ends. Any suggestions would be greatly appreciated. Thank you.

      I have this in the Document JavaScripts:

      var ITrig = 1;

      I have three Buttons (want to have more) that will set the ITrig variable.

      Here is what I have in one Button:

      var Inpopup = this.getField("PartASectionIIInstructions")

      ITrig = 2;


      if (Inpopup.display == display.hidden) {
      Inpopup.display = display.visible
      } else {
      Inpopup.display = display.hidden;

      I have this in the PartASectionIIInstructions Text Field in the Custom Calculation Script:

      if (ITrig == 2) {
      event.value = "#2";
      else if (ITrig == 3) {
      event.value = "#3";
      else if (ITrig == 4) {
      event.value = "#4";