Add a Button that Runs a Computation Variable

From HotDocs Wiki

Jump to: navigation, search
Note: HotDocs 2006 and later users: Please see the HotDocs Help for instructions on creating a script link dialog element.

You can add a button to a HotDocs dialog that processes a Computation variable. This may be useful if you want to perform a calculation or other type of command and have the result immediately take effect. For example, you can write a computation that sorts a list of answers in a repeated dialog and place a button on the repeated dialog that runs the computation. Then, when users enter answers in the dialog, they can press the button to sort the answers alphabetically.

To add a button that runs a Computation variable

  1. Open the dialog in the Dialog Editor.
  2. In the Additional text box, type @COMPUTE:computationName:buttonText.
  3. Replace computationName with the name of the Computation variable you want to run.
  4. Replace buttonText with the text which will appear on the button.
  5. Drag the additional text to the Contents box, placing it where you want the button to appear on the dialog.

CAUTION: Computation variable names used in @COMPUTE instructions are not recognized as such by Template Manager (Component Explorer in version 6.1 and earlier). If you use Template Manager (or Component Manager) to rename the original Computation variable, it will not be updated in the @COMPUTE instruction.