[FEATURE] Add pattern attribute to TextfieldViewHelper 01/35601/3
authorRoman Schuermann <roman.schuermann@wmdb.de>
Sat, 20 Dec 2014 15:22:27 +0000 (16:22 +0100)
committerFrank Nägler <typo3@naegler.net>
Sat, 20 Dec 2014 16:11:36 +0000 (17:11 +0100)
In order to allow HTML5 validation, the Textfield ViewHelper needs
"pattern" as an attribute.

Resolves: #62428
Releases: master
Change-Id: Idbb35fafec2220c255e2ae3f82ad30f8fe84133d
Reviewed-on: http://review.typo3.org/35601
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Frank Nägler <typo3@naegler.net>
Tested-by: Frank Nägler <typo3@naegler.net>
typo3/sysext/fluid/Classes/ViewHelpers/Form/TextfieldViewHelper.php

index d604d6b..72779d7 100644 (file)
@@ -46,6 +46,7 @@ class TextfieldViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractForm
                $this->registerTagAttribute('readonly', 'string', 'The readonly attribute of the input field');
                $this->registerTagAttribute('size', 'int', 'The size of the input field');
                $this->registerTagAttribute('placeholder', 'string', 'The placeholder of the textfield');
+               $this->registerTagAttribute('pattern', 'string', 'HTML5 validation pattern');
                $this->registerArgument('errorClass', 'string', 'CSS class to set if there are errors for this view helper', FALSE, 'f3-form-error');
                $this->registerUniversalTagAttributes();
        }