I've followed tutorial 3 to build my form successfully, now how do I get it to display a thank you message after the form has been submitted?
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Create a new page called Thank you, and after performing the jobs you wish to do with the form use the Director to redirect the user to the thank you page you created.
Director::redirect("");
Is there a way to get back to the original form page but this time with the added 'Thank You' message at the top of that page?
you can direct the user to the same page with the following
Director::redirectback();
and to add a custom message to the form just do this in you form processing page,
$form->addErrorMessage("Blurb", 'Page Saved Successfully', "good");
Thanks for that, it all works well!!