Jump to:

2011 Posts in 1436 Topics by 620 members

Form Questions

SilverStripe Forums » Form Questions » Session setFormMessage

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

Page: 1
Go to End
Author Topic: 407 Views
  • spierala
    Avatar
    Community Member
    80 Posts

    Session setFormMessage Link to this post

    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

    407 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.