Buy Now
Sign in

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

WhiteLighter01 , September 09 2016
Answered
W
WhiteLighter01

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 ^_^

GreyHead

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.

				<?php
unset($form->data);
$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:
				<?php
if ( !empty($form->data['reload']) ) {
echo '<p>Some thanks message</p>';
}
?>

Bob

Bob

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