Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > JavaScript API > Control object > Methods

JavaScript API: Control object > on()

Scroll Prev Next More


Adds an event to the control and transfer the array of arguments to the handler.





one of the available event values.


the function performed after the event was fired.

Return value

No return value.


Add the 'click' event to the control using the JavaScript OnLoad event:


ctrl.on('click', function() {
// call the 'setValue' method to set a new value

See also:

JavaScript API: Control object > setValue()

JavaScript API: Control object > clearEvent()

Example: Show dropdown list of US states if US was selected in country list

Example: Ask for confirmation before saving a record

Example: Show order total on the Edit page as the details table is updated

Events: JavaScript OnLoad

JavaScript API: Control object

JavaScript API