You can add any handler to the events of Form. To do this, use the form.events.on() method with the following parameters:
evName | name of the event |
evHandler | user-defined event handler |
form.events.on("Click", function(name,e){
console.log(id);
});
Several handlers can be attached to one and the same event, and all of them will be executed.
The names of the events are case-insensitive.
There is a simple way of removing an event handler with the form.events.detach() method:
form.events.on("Click", function(name,e){
console.log(id);
});
form.events.detach("Click");
A custom event can be called with the fire() method of the events module:
form.events.fire(evName,[args]);
You can find the full list of Form events in the API section.
Back to top