Redirect + success message

Display a formatted success message after a redirect in ChronoForms.

Overview

The standard redirect action does not allow showing a custom, formatted message on the target page.
Use a Custom Code action to save the message to the user session during form submission, then add code to the target page template to retrieve and display the formatted message from the session.

Answered
dt dtws2008 02 Dec, 2015
Hello,
I need to redirect on successful submit and display a success message at the targeted page. I can't find a way to do this.
I can redirect, I can display a message but I can't display a message at the targeted page.
Any idea?
Gr GreyHead 02 Dec, 2015
Hi dtws2008,

You can use the Joomla! methods to display a message on the new page. Instead of the ReDirect action add a Custom Code action with code like this
<?php
$app = \JFactory::getApplication();
$app->enqueueMessage('Some message here');
$app->redirect('/index.php?. . .);
?>

Bob
dt dtws2008 02 Dec, 2015
Thanks bob!
two problems:
1. I have to insert the full url (http://.......), instead the relative one.
2. It is a system message. I need to display a formatted message at a template location.
dt dtws2008 02 Dec, 2015
Fixed problem 1 ($url=JURI::root())
Any idea for problem 2?
Gr GreyHead 02 Dec, 2015
Answer
1 Likes
Hi dtws2008,

There isn't any simple way for ChronoForms to control the content on another page and you probably don't want to include the message in a URL.

One solution might be to save the message to the User session in the form - then add a little ChronoForm (or some custom PHP) in the template location that checks the session for a message and displays it if one is found.

Bob
This topic is locked and no more replies can be posted.