Each Output Workflow is able to process its own success workflow.
If you're adding a text type, the form is just returning the text value you could use for a output. "Thank you for your message" for example.
A Snippet could be useful if you need more output structure. FormBuilder will render the snippet and return its html data.
Use a document to get its path to perform a redirect for example.
If you're using Document
as a success handler you're able to define a flash message.
To define a flash message you need to fill out the Flash Message
below.
Be sure you have included the twig template somewhere on top in your main layout:
{% include '@FormBuilder/Common/redirect_flash_message.html.twig' %}
This is how your javascript listener could look like:
$('form.ajax-form').on('formbuilder.success',
function (ev, message, redirect, $form) {
if (redirect) {
document.location.href = redirect;
} else {
alert(message[0]['message']);
}
}
);