Buy Now
Sign in

redirect back to the same form with confimation/thank you message on top upon submit

WhiteLighter01 , September 09 2016
Hi all,

After being away from web development for a couple of years, I'm back.

What I need to do is, after submit, is to display the thank you/confirmation message at the top of the form and clear the form of any values entered, instead of showing a thank you/confirmation page. How should I approach this?

Thanks in advance for all the help/guidance ^_^
Hi WhiteLighter01,

Here's one way to do this.

At the end of the On Submit action add a Custom Code action that a. unsets the form data and b. sets a trigger value to say this is a reload.
$form->data['reload'] = 1;

In the Designer tab add a Custom Code element at the top of the form that will show the Thank you message only if reload is set:
if ( !empty($form->data['reload']) ) {
echo '<p>Some thanks message</p>';


ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much