Adding JavaScript Code to Fields
You can add JavaScript code to individual fields using the field's Edit icon in the Admin application, and then the Field Condition input box. Field conditions can be used when a selector is being opened for a field. The supported event handlers in this context are:
- conditionQueryJSON
- excludeFromPreLoad
- fieldsOnConditionQuery or conditionQuery (NOTE: These events are paired and must be used together.)
- fieldsOnFilter or onFilter (NOTE: These events are paired and must be used together.)
To add JavaScript code to fields:
- Start the Admin application.
- Click Map Settings on the vertical navigation bar, and then con the module you with to edit.
- Click Edit next to the field where you want to add the JavaScript code.
- In the Field Condition Tab will be the input box. Enter the JavaScript code here.
- Click Update to complete.
The Field Condition Tab will only be available where Field Type is either KEYWORD or REFERENCE.
Note that the event handlers must be the first methods mentioned in the inline JavaScript code in the Field Condition input box because the first methods are automatically registered as the event handlers. Any event handlers that are stored in libraries will not be called.