How do I add custom code to a button in my Form Type?
Custom code can be called when the user taps an Action Button in the form.
Custom TPL can be added to an Action Button's ON *BUTTON event. The custom code is executed when the user taps the Action Button.
Insert an Action Button into your form.
Enter a name in the Action Name property for the Action Button. The name must start with a letter and may only contain letters (upper and lower case) and numbers.The Action Name must contain a valid name if you want to add custom TPL to the Action Button.
Click Save Commands to return to the Form Properties screen.
Open the TPL Editor for the form that contains the calculated field. Go to Advanced Features > Edit Custom Code.
Select the Yes radio button above the Edit Custom Code link to enable the TPL editor.
Click the Button button to open the *ON BUTTON event for the button.
Enter the TPL to execute. In this example, the area is being calculated from the length and width fields and being stored in the area field:
ON *button_calculateArea #area = #length * #width ENDONField names are case sensitive!
Click Save to save your calculation.
After you have added the TPL to the ON *BUTTON event for the button, click Save on the left-hand side of the screen to save your changes. Then, click Click to save changes to upload your changes to the TransForm Cloud.
Finally, test your form in the TransForm Filler mobile application.