Including the API in your widget
Setting the return value of the widget
Widgets can store a value just like other types of fields. If you want your widget to return a value to the form, you can use the SetReturnValue() function.
The value returned is stored as a string (text) and can be used to determine skip logic and can have validation rules applied.
Accessing data passed to the widget
Often, values are passed to a widget from the main form. These can be retrieved from the widget using the GetParameter() function.
// This example assumes you pass two parameters to the widget: "mode" and "limit". var mode = MobenziWidgetAPI.GetParameter('mode'); var limit = MobenziWidgetAPI.GetParameter('limit');
Programmatically setting the widget field height
In some cases, you might want to set the height of the custom widget dynamically to avoid displaying scrollbars and have the widget's height match the content that it contains. This can be achieved by calling the SetHeight() function.