Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Form Questions

How to display a messge after form submission


Reply

5 Posts   2847 Views

Avatar
mango

5 May 2009 at 5:36pm Community Member, 26 Posts

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?

Avatar
Nivanka

8 May 2009 at 3:28am Community Member, 395 Posts

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("");

Avatar
mango

8 May 2009 at 5:31pm Community Member, 26 Posts

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?

Avatar
Nivanka

8 May 2009 at 7:09pm Community Member, 395 Posts

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");

Avatar
mango

8 May 2009 at 9:31pm Community Member, 26 Posts

Thanks for that, it all works well!!