Setting the text that the button displaysAdded by IBM on October 10, 2012 | Version 1 (Original)
|This topic describes how to set the text displayed by a signature button, both prior to being clicked and after being clicked by the user. A compute can also be used to set the text displayed by a signature button.
Signature buttons switch between two states: unsigned and signed. When a signature button is unsigned, it is generally good practice to have the button display instructions, such as "Click here to sign". When a signature button is signed, it is generally a good practice to show the identity of the person who signed it.
Since buttons display the text in their value option, you must set the value option appropriately, depending on whether the button is unsigned or signed. To do this, you must use a compute.
The compute for this relies on the button's signer option. The signer option is created by the Viewer when the button is signed. This means that there is no signer option until the user clicks the button to sign the form.
With this in mind, you can create a simple test to set the value of the button. If the signer option has no value (that is, if it does not exist), then there is no signature and the button should read "Click here to sign". If the signer option has a value, then there is a signature and the button should show the identity of the signer. Since the signer option stores the signer's identity, the button's value can bet set to equal the signer option.
More formally, you might express this logic as: if the signer option is empty, then set the button's value to "Click here to sign"; otherwise, set the button's value to equal the signer option.
In XFDL, you would write this as follows:
<value compute="signer == '' ? 'Click to sign' : signer"></value>