When a row with a repeated element or container was added.
A callback for printing the form. The callbacks are invoked after a form was printed (such as by the print service). You can use this callback to undo preparations made by print.
Before the values of a set of form elements are cleared.
Before the values of a set of form elements are reset to their default values.
When the value of a form element was cleared.
When a row with a repeated element or container was deleted.
When a form element was disabled.
When a form element was enabled.
When a file was changed, both for normal and for automatic upload elements.
When a form element was switched from visible to hidden.
A callback for the print service. The callbacks are invoked when just before a form is printed (such as by the print service). You can use this callback to prepare the form for printing. When the callback returns a promise, the print service waits for the promise to fulfill before printing the form. When the promise is rejected, the error is logged, but does not prevent the print.
To clean up after printing, use afterPrint.
When a form element was set to read-only.
When a set of form elements hda their values reset to the default values.
When a form element was switched from hidden to visible.
A callback for when the form is submitted. Can be used e.g. to run additional actions or to prevent the submission.
The callback is called after the form was validated, if the submit button requires validation.
$.xutil.on("submit", () => doSomething())
$.xutil.on("submit", ({submissionBlocked}) => {
// Check if the submission is already blocked
if (submissionBlocked) {
return;
}
// Custom code to be run on submission
// Custom logic to check whether the form submission should be cancelled.
const preventSubmission = customLogic();
return { preventSubmission };
});
Mapping between event names and callback types for callbacks that can be registered via XUtil.on.