Form - Events & Methods
Events
Form behavior can be customized with the help of the call-back events. These events can be accessed from the events tab on the Properties panel. The trigger for the event can be JavaScript, another Variable call etc..
Event | Trigger and JavaScript Usage |
---|---|
On before submit | This event will be called before submitting the form. Any validation checks can be performed here. Returning false from the script will stop the form submit. |
We are assuming that Notification Action notificationAction1 is already created.
Event | Trigger and JavaScript Usage |
---|---|
On submit | This event will be called on submitting the form. (This is called after ‘on before submit’. If on before submit returns false, this function will not be called). |
Event | Trigger and JavaScript Usage |
---|---|
On result | This event will be called after the form is submitted and API returns a response. This event is triggered in both success and failure cases. |
Event | Trigger and JavaScript Usage |
---|---|
On success | This event will be called after the form is submitted and API returns a success response. |
Event | Trigger and JavaScript Usage |
---|---|
On error | This event will be called after the form is submitted and API returns a failure response. |
Methods
Form has few methods exposed on widget scope.
- To submit form:
- To clear messages from the form: