thank you message not thank you page !

dmorton2 08 Jan, 2009
Am new to using ChronoForums, iv managed to style it for my contact page but i do not want it after the user clicks submit to goto another page !

is it possible for the thank you message to be displayed on the same page ie under the submit btn ?????
so if there is away please could some one tell me how !! thank you
GreyHead 08 Jan, 2009
Hi dmorton,

You can redirect back to your contact page using the ChronoForms ReDirect URL.

To show a message you could either use some conditional php in the form html. Or, more simply add a Joomla message with some code in the OnSubmit After box
<?php
global $mainframe;
$mainframe->enqueuemessage('Thanks for your message, we will get back to you shortly');
?>

Bob

Later : fixed an error - replaced : with ;
dmorton2 08 Jan, 2009
hi bob thanks for the quick reply!

like i said am new to this and joomla !!
i added that php code to the "On Submit code - after sending email:" but that just went to a blank page
i also tried the redired link back to contactpg which is sort of what i want but if possible with out the reload
all i want is just the message to show after clicking submit!

do you know away for this ?
GreyHead 08 Jan, 2009
Hi dmorton2,

Hmmm . . . You should see the message . . . but still.

If you want a form to submit without a page reload then you'll need to build an AJAX form I think. I'm sure it's possible - but beyond my current experience with ChronoForms.

Bob
Max_admin 08 Jan, 2009
Hi dmorton2,

I posted how to make an AJAX form here in the forums a while back, search for AJAX

regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 09 Jan, 2009
Hi dmorton2,

I think this is the AJAX form Max is referring to. It's a while back so some of the code may be for CF 2.5 but the main ideas should be good.

Bob
tvdsluijs 31 Mar, 2010

Or, more simply add a Joomla message with some code in the OnSubmit After box

<?php
global $mainframe;
$mainframe->enqueuemessage('Thanks for your message, we will get back to you shortly');
?>

Bob



Hmmmm this does not seem to work for me. It should be placed on Form Code -> OnSubmit Event Code -> "OnSumbit Code After Sending Email", right ?

Joomla! 1.5.15
Chrono 3.1 RC5.5
GreyHead 31 Mar, 2010
Hi tvdsluijs,

Yes that's the right place. If it doesn't show a message then your template may not support Joomla System Messages (a surprising number of them don't).

Bob
tvdsluijs 31 Mar, 2010
Hmmmm, the template does support messages.
tvdsluijs 31 Mar, 2010
Solved !

<?php
JFactory::getApplication()->enqueueMessage( 'Thanks for your message, we will get back to you shortly' );
?>

That works for me !
GreyHead 31 Mar, 2010
Hi tvdsluijs,

Well done !!

And now I see the problem with my code snippet it should be a ; after global $mainframe; (I fixed the earlier post).

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