0

I have a Webform (6.x) with style Cards, and Ajax.

I would like the users to be able to personalize the message shown as confirmation of the form, with paragraphs and the like.

With a regular webform we have implemented a custom handler with a redirect to a node. With the Cards/Ajax it would be interesting to show the content of that node (configured in the handler) as a confirmation message.

Any suggestion on how we could, from a custom handler, I guess that with the confirmForm function, "catch and replace" the confirmation message?

1 Answer 1

1

I have found the solution myself after debugging. Leaving it here for further reference: based on https://git.drupalcode.org/project/webform/-/blob/6.1.x/src/Plugin/WebformHandlerBase.php#L607

public function preprocessConfirmation(array &$variables) {}

Implementing this we can easily modify the message as a simple "markup" element in

$variables['message']
1
  • It works is most cases except when I've to show message in modal dialog box.
    – Sharique
    Dec 8, 2022 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.