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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Form Validation - Messages - Post Data


Go to End


804 Views

Avatar
StefanX201

Community Member, 9 Posts

25 April 2014 at 12:01am

Edited: 25/04/2014 2:10am

Hi,

is it possible to add multiple "Error" Messages during validating Form Data and before redirecting to the Form for showing Validation Errors? This is another Topic where Documentation is really shortcutted.

Is there any Functionality for adding FlashMessages? I mean messages that i can catch up after redirecting?

Another interesting Question is, if it is possible to redirect with some inputted Data to reuse after Validation or some other Process? Like

Controller::curr()->redirectBack()->with($data) where $data is an array

How can i put POST Data into to View when i want to build a hardcoded Form like

<% include SideBar %>
<div class="content-container unit size3of4 lastUnit">
	<article>
		<h1>$Title</h1>
		<div class="content">$Content</div>
	</article>
		
		<form action="{$URLSegment}/processForm" method="post">
			
			<div>
				<input type="text" name="email" value="{$Email}">
			</div>

			<input type="submit" value="send">

		</form>

		$PageComments
</div>

And really helpful could an example of : How catching up Error Messages that are added by

$form->addErrorMessage("Password", "Error Message 1","bad");
$form->addErrorMessage("Password", "Error Message 2","bad");
$form->addErrorMessage("Email", "Error Message 3","bad");

Cant find Examples or Docs of that. Can just read about people who are lot of confused about still Implemented but not Showcased functions.