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

Session setFormMessage


Reply

425 Views

Avatar
spierala

14 August 2012 at 7:06am Community Member, 80 Posts

Hello,
I was just building a custom form in SS3 as described here:

http://doc.silverstripe.org/framework/en/topics/forms

works far so fine. Now I´m setting the message which is going to be displayed after submit like that:

Session::setFormMessage($form->FormName(), "Thank You.", "good");

Now the annoying thing is that the message is displayed forever even when the form is reloaded.
How can I make that message disappear after reload?

here the template code:

<% if Message %>
<p id="{$FormName}_error" class="message $MessageType">$Message</p>
<% else %>
<p id="{$FormName}_error" class="message $MessageType" style="display: none"></p>
<% end_if %>

Thank you,
Florian