Callbacks


If a form field that has a callback is edited, the "Callback" tab is displayed:

admin_formfields_11_de.png

The syntax of the callback can be checked using the "Validate" button. The "Apply" button adds the callback to the form and can be tested interactively. The "Reset" button discards all changes and resets the callback to its original state.

Callbacks are used to actively respond to user input in a form. Buttons can be given actions, text fields and categories and many other form types can be given dynamics using callbacks.

A callback of a text field to count the number of characters entered looks like this, for example:

var text = helper.getFormValue("SMS versenden", "Text");

var rest = 160;
if(text!=null){
rest = 160-text.length();
}
helper.setFormValue("SMS versenden", "Restzeichen", ""+rest);