Forums

[Solved] Show Confirmation in Joomla Message Box?

ironlion37 21 Oct, 2013
Hi, is it possible to show a confirmation message (thanks message) on submit within the Joomla info box that most templates have?

Edit:
Answer: insert this code into the "Custom Code" event after emails (must be be in advanced mode of form wizard):
<?php
$app =& JFactory::getApplication();
$app->enqueuemessage('Your message goes here');
?>


Thanks Bob!
GreyHead 22 Oct, 2013
Hi ironlion,

Yes, there is a Show Message action (but don't use that to show an error message).

You can also just use a Custom Code action with PHP:
<?php
$app =& JFactory::getFramework();
$app->enqueuemessage('Your message goes here');
?>

Bob
ironlion37 22 Oct, 2013
Thank you Bob! Would that be the "Show Thanks Message" event under "Core Actions"?

One other question: I'm using 4.0 RC3.5.2 on this particular site (Joomla 2.5.8). The form I want to apply this action to was created in the "Easy Form Wizard" - where I cannot add events. Is there a way to convert that form or do I have to recreate it in the (non easy) Form Wizard?
GreyHead 22 Oct, 2013
Hi ironlion37,

I think you probably need to use the Code after Email box in the Easy Wizard - the Thanks Page doesn't accept PHP if I remember correctly.

Please see this FAQ about changing to the Form Wizard.

Bob
ironlion37 22 Oct, 2013
Thanks Bob, I converted the form to the advanced wizard which gave me a custom code box. However, when I entered the code you provided (trying both the controller and view options in the custom code box), it gives this error on form submit:

Fatal error: Call to undefined method JFactory::getFramework() in /.../components/com_chronoforms/form_actions/custom_code/cfaction_custom_code.php(16) : eval()'d code on line 2
GreyHead 22 Oct, 2013
Hi ironlion37,

Sorry, trying to do too many things at once :-(

Please try: $app =& JFactory::getApplication();

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