[BUGFIX] EXT:form - set maximum field length as attribute "maxlength" 24/52224/3
authorMartin Kutschker <masi@typo3.org>
Tue, 28 Mar 2017 20:19:15 +0000 (20:19 +0000)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Wed, 29 Mar 2017 09:49:43 +0000 (11:49 +0200)
Also set minimum field length as attribute "minlength"

Resolves: #80126
Resolves: #80128
Releases: master
Change-Id: I1649dae4098f2b5f4ae1d99e3550c07bfc9af12a
Reviewed-on: https://review.typo3.org/52224
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Jurian Janssen <jurian.janssen@gmail.com>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/core/Documentation/Changelog/master/Feature-80126-ExtFormSetMaximumFieldLengthAsAttribute.rst [new file with mode: 0644]
typo3/sysext/form/Configuration/Yaml/FormEditorSetup.yaml

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-80126-ExtFormSetMaximumFieldLengthAsAttribute.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-80126-ExtFormSetMaximumFieldLengthAsAttribute.rst
new file mode 100644 (file)
index 0000000..70c3b6e
--- /dev/null
@@ -0,0 +1,37 @@
+.. include:: ../../Includes.txt
+
+================================================================
+Bug: #80126 maximum field length not set as attribute "maxlength"
+================================================================
+
+See :issue:`80126`
+See :issue:`80128`
+
+Description
+===========
+
+If a form element is set to be use the 'String length' server side validation through the form editor, the client side validation properties 'minlength' and 'maxlength' will be rendered
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+Result:
+
+.. code-block:: typoscript
+
+    renderables:
+      -
+        type: <formElementType>
+        ...
+        properties:
+          fluidAdditionalAttributes:
+            minlength: 2
+            maxlength: 3
+            ...
+        validators:
+          -
+            identifier: StringLength
+            options:
+              minimum: 2
+              maximum: 3
+
+.. index:: Frontend, Backend, ext:form
+
index f88d85a..cf24f02 100644 (file)
@@ -947,6 +947,12 @@ TYPO3:
                         20: 'TYPO3.CMS.Form.mixins.formElementMixins.MinimumMaximumEditorsMixin'
                       100:
                         label: 'formEditor.elements.TextMixin.validators.StringLength.editor.header.label'
+                      200:
+                        additionalElementPropertyPaths:
+                          10: 'properties.fluidAdditionalAttributes.minlength'
+                      300:
+                        additionalElementPropertyPaths:
+                          10: 'properties.fluidAdditionalAttributes.maxlength'
                   40:
                     identifier: 'EmailAddress'
                     editors: