contao/test — Issue #449: "Preserve" Invalid form data
Author: importer
Created: 2011-11-29 06:15:00+00:00
State: open
Labels: Feature, framework

On the backend, a user enters an invalid entry in a field. Instead of it blanking or reverting to the saved copy, it stays invalid when the form is returned for correction.

I am creating an extension with a custom regx to limit the news teaser length to 100 words. If the person goes over, the form returns with an error but what they entered is gone and they have to start over.

What I propose is the following:

A field evaluation parameter "preserve". When set to true, the invalid entry is returned for editing.

Attached is a changed version of 3.6.4 Widget.php that implements THOUGH I am not sure if correctly.

Changes:
Line 105: Add variable $preserveField

Line 181-183: Set $preserveField to preserve flag

Line 417: add OR if preserveField is True, then set the return value

Frontend with the form generator would be desired as well. When adding a field to a form, it contains a checkbox option to Preserve invalid entries.

[Download the attachments](http://www.contao.org/tl_files/tickets/449.zip "Download the attachments of this ticket")

--- _Originally created by bumforaliving on January 25th, 2009, at 03:38am (ID 449)_