Custom Events Bronze Plan
Customize your form's behavior further by listening for our custom events!
Listening for our events
Listening for our custom events is the same as listening for any other Javascript event. Give your form a unique id
. Next you would need to add an addEventListener()
method. Below is a basic example of listening for a kwSubmitted
event that fires when a form is submitted successfully:
var form = document.getElementById('myForm');
form.addEventListener('kwSubmitted', function () { // add your own custom logic :) });
Available custom events
Event | Description |
---|---|
kwOnSubmit | Fires when the submit button from your form is clicked. |
kwHasErrors | Fires when a validation error occurs on your form. |
kwSubmitted | Fires when a form is successfully submitted. |
kwMultistepPrevClicked | Fires when the “previous” button is clicked on a multistep form. |
kwMultistepPrevSuccess | Fires when the previous step is reached in a multistep form. |
kwMultistepNextClicked | Fires when the “next” button is clicked on a multistep form. |
kwMultistepNextSuccess | Fires when the next step is reached in a multistep form. |
kwRepeaterAddClicked | Fires when the “add” button is clicked on repeater field groups. |
kwRepeaterAddSuccess | Fires when a group of fields is successfully added on repeater field groups. |
kwRepeaterRemoveClicked | Fires when the “remove” button is clicked on repeater field groups. |
kwRepeaterRemoveSuccess | Fires when a group of fields is successfully removed on repeater field groups. |
Any suggestions?
If you have any suggestions for new custom events. Send us a message!.
Notice anything wrong in our docs? Let us know.