[TYPO3-mvc] validate <f:form inputs and redirect on error

Manfred Rutschmann manfred.rutschmann at revier.de
Tue Jun 1 10:19:10 CEST 2010


hi list,

im creating a backend module an have some forms. one question about the
validator: a publisher filled out some fields an the validator brings the
error messages on the form. and all inputs are now empty... huh?

What i have to do to bring the inputs back to the form?

Form:
<f:form method="post" controller="BeTool" action="create" name="Tool"
object="{Tool}" >
	<h4>Werkzeug: Allgemeine Einstellungen</h4>
	<table width="100%">
	<tr><td><label for="title"><strong>Title</strong></label><br />
		<f:form.textbox property="title" /><br />
	</td>

....

Domain/Model:
        /**
         * @var string
         * @validate StringLength(minimum = 2, maximum = 255)
         */
	    Protected $title;


			

Another question to the f:translate: i used the mittwald documentation an
there is an example for translated error messages. but by me that don't
work. Example:

	<f:form.errors for="Tool">
		<div class="formerrorstext">
			<strong>{error.propertyName}</strong><br />
			<f:for each="{error.errors}" as="fieldError">
				<f:translate key="Tool_Error_{error.propertyName}_{fieldError.code}" />
				{fieldError.code}: {fieldError.message}
			</f:for>
		</div>
	</f:form.errors>

i get the errormessage from {fieldError.code}: {fieldError.message} but no
output from <f:translate
key="Tool_Error_{error.propertyName}_{fieldError.code}" />

what ist going wrong?

thx manfred


More information about the TYPO3-project-typo3v4mvc mailing list