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.

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.

Form Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Clearig Form Messages


Go to End


3 Posts   1624 Views

Avatar
zenmonkey

Community Member, 545 Posts

15 April 2014 at 6:16am

I has a custom form that I return a message to when the submission succeds, how to do I clear that message on subsequent page load so its not always there?

Avatar
camfindlay

Forum Moderator, 267 Posts

15 April 2014 at 11:07am

Can you provide more information like the form code or how you set the message after the form submission?

Are you using $form->sessionMessage()?

Avatar
zenmonkey

Community Member, 545 Posts

16 April 2014 at 1:35am

Right now I'm using

$form->addErrorMessage('Message', 'Message Body' , 'success');

I guess I'll try sessionMessage()