[TYPO3-mvc] Multi step forms and validation

Nikolas Hagelstein hagelstein at shr.cc
Tue Oct 27 16:40:07 CET 2009


Hi,

I am currently wrapping my head around multistep forms and validation.
Example:

Step 1 consists of fieldA
So the Step2 action would look like @validate $fieldA notEmpty or similar

Step2 consist of fieldB 
So the Step3 action would look like @validate $fieldB notEmpty and so on.

In case fieldB is empty extbase throws the request back to step2 where it
tries to validate fieldA which isn't existing at this point.
So validation for fieldA fails and extbase throws the request back to step3.

So step2 and step3 are playing a nice round of pingpong until the infinity
loop protection steps in.

One way to solve this issue would be to add hidden form fields for all
"neighbour views". But this would result in a huge overhead.
Especially if a new field is introduced.

Though this overhead could be reduced by writing the one step fields to a
session and extracting them in the initializeAction and passing them to the
view. Anyway still view overhead.

I wonder if there is a better solution.

Cheers,
Nikolas




More information about the TYPO3-project-typo3v4mvc mailing list