[TYPO3-mvc] ajax and validation

Christian Kartnig office at hahnepeter.de
Thu Nov 27 11:04:28 CET 2014


Hi!

The view is not the problem, the problem is to detect the validation 
errors within the action (is this possible within initializeAction?) and 
to send appropriate Error messages via json.

Of course I could create a view, where only the validation Errors are 
displayed and extract the errors using jQuery, but I was looking for a 
cleaner solution.

best regards,
Christian


Am 25.11.14 12:33, schrieb Matthew Colton:
> Use a PHP as a viewpattern? Why not use a viewhelper?
>
> Cheers
> Matthew
>
> Am 25.11.2014 um 11:56 schrieb Philipp Wrann:
>> You could realize that in the initializeCreateAction
>>
>> Maybe you can simply detect the type and if its ajax switch your
>> prefered view, then you can render the validation in a php view for
>> example.
>> You would have to place a New.php file in your templates folder and
>> set the viewpattern to php.
>>
>> In that php file you can return a json_encode with your falttened
>> validation errors.
>>
>> I have never done this that way but it should be possible.
>> _______________________________________________
>> TYPO3-project-typo3v4mvc mailing list
>> TYPO3-project-typo3v4mvc at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>>
>



More information about the TYPO3-project-typo3v4mvc mailing list