ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

Redirect + success message

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?
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
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.
dtws2008 02 Dec, 2015
Fixed problem 1 ($url=JURI::root())
Any idea for problem 2?
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.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com