diff --git a/Classes/ViewHelpers/Validation/FieldTypeFromValidationViewHelper.php b/Classes/ViewHelpers/Validation/FieldTypeFromValidationViewHelper.php index 7d35bb2a4..ef4e25415 100644 --- a/Classes/ViewHelpers/Validation/FieldTypeFromValidationViewHelper.php +++ b/Classes/ViewHelpers/Validation/FieldTypeFromValidationViewHelper.php @@ -20,6 +20,8 @@ class FieldTypeFromValidationViewHelper extends AbstractValidationViewHelper 2 => 'url', 3 => 'tel', 4 => 'number', + 6 => 'number', + 7 => 'number', 8 => 'range', ]; diff --git a/Documentation/ForEditors/FieldInput.md b/Documentation/ForEditors/FieldInput.md index 973b84ec0..187771286 100644 --- a/Documentation/ForEditors/FieldInput.md +++ b/Documentation/ForEditors/FieldInput.md @@ -49,14 +49,14 @@ Administrator can enable or disable the validation in general with TypoScript (s | Validation Type | Description | Examples | Note | |-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Mandatory | This simple checkbox forces the user to add a value for the current field. | any text | The HTML5 attribute required="required" is used if HTML5-Validation is turned on. | -| Email | If email validation is turned on, the visitor has to fill in the field with a correct email address or let it empty. | firstname.lastname@domain.org
name@subdomain.domain.org | No HTML5 type - type="text" is used | +| Mandatory | This simple checkbox forces the user to add a value for the current field. | any text | The HTML5 attribute required="required" is used, if HTML5-Validation is turned on. | +| Email | If email validation is turned on, the visitor has to fill in the field with a correct email address or let it empty. | firstname.lastname@domain.org
name@subdomain.domain.org | input with type="email" is used, if HTML5-Validation is turned on. | | URL | If url validation is turned on, the visitor has to fill in the field with a correct url. | http://www.test.org
www.test.org | No HTML5 type - type="text" is used | -| Phone | If turned on, visitor must leave a string with a phone syntax. | 01234567890
0123 4567890
0123 456 789
(0123) 45678 - 90
0012 345 678 9012
0012 (0)345 / 67890 - 12
+123456789012
+12 345 678 9012
+12 3456 7890123
+49 (0) 123 3456789
+49 (0)123 / 34567 - 89 | input with type="tel" is used if HTML5-Validation is turned on. | +| Phone | If turned on, visitor must leave a string with a phone syntax. | 01234567890
0123 4567890
0123 456 789
(0123) 45678 - 90
0012 345 678 9012
0012 (0)345 / 67890 - 12
+123456789012
+12 345 678 9012
+12 3456 7890123
+49 (0) 123 3456789
+49 (0)123 / 34567 - 89 | input with type="tel" is used, if HTML5-Validation is turned on. | | Numbers only | If turned on, visitor can only fill in numbers (no space or other characters allowed) | 123
68465135135135185 | input with type="number" is used if HTML5-Validation is turned on.

Leading zeros are removed, so this validation type cannot be used to validate German ZIP codes. Use the `pattern` type instead. | | Letters only | If turned on, visitor can only fill in letters (no space, no numbers, no special characters, no umlauts and no accent allowed) | abc
qwertz | No HTML5 type - type="text" is used | -| Min Number | Min Number is used to check if a number (integer) is greater then a configured number. So the visitor has to insert an integer.
If turned on, an additional field "Validation Configuration" comes up. Validation depends on the value in this field. The editor should enter an integer in this field - e.g. 3 | 3 => 4 or 5 or 1000 or more
123 => 124 or 1000 or 99999 or more | No HTML5 type - type="text" is used | -| Max Number | Max Number is used to check if a number (integer) is less then a configured number. So the visitor has to insert an integer.

If turned on, an additional field "Validation Configuration" comes up. Validation depends on the value in this field. The editor should enter an integer in this field - e.g. 3 | 3 => 2 or 1 or 0
123 => 122 or 100 or 10 or less | No HTML5 type - type="text" is used | -| Range | Range allows the visitor to add an integer between a start and a stop value.

If turned on, an additional field "Validation Configuration" comes up. Validation depends on the value in this field. The editor should enter a start and a stop value - e.g. 5,15 for start with 5 and stop with 15 | 5,15 => 5 or 10 or 15
0,100 => 1 or 25 or 100 | input with type="range" is used if HTML5-Validation is turned on. | +| Min Number | Min Number is used to check if a number (integer) is greater then a configured number. So the visitor has to insert an integer.
If turned on, an additional field "Validation Configuration" comes up. Validation depends on the value in this field. The editor should enter an integer in this field - e.g. 3 | 3 => 4 or 5 or 1000 or more
123 => 124 or 1000 or 99999 or more | input with type="number" is used, if HTML5-Validation is turned on. | +| Max Number | Max Number is used to check if a number (integer) is less then a configured number. So the visitor has to insert an integer.

If turned on, an additional field "Validation Configuration" comes up. Validation depends on the value in this field. The editor should enter an integer in this field - e.g. 3 | 3 => 2 or 1 or 0
123 => 122 or 100 or 10 or less | input with type="number" is used, if HTML5-Validation is turned on. | +| Range | Range allows the visitor to add an integer between a start and a stop value.

If turned on, an additional field "Validation Configuration" comes up. Validation depends on the value in this field. The editor should enter a start and a stop value - e.g. 5,15 for start with 5 and stop with 15 | 5,15 => 5 or 10 or 15
0,100 => 1 or 25 or 100 | input with type="range" is used, if HTML5-Validation is turned on. | | Length | Length allows the visitor to add characters and numbers. But the length is validated.

If turned on, an additional field "Validation Configuration" comes up. Validation depends on the value in this field. The editor should enter a start and a stop length - e.g. 5,15 for startlength on 5 and stoplength on 15 | 5,15 => ab or abc23efg or abcdefghijklmno
0,3 => 1 or ab or abc | No HTML5 type - type="text" is used | | Pattern | The visitors input will be validated against a regulare expression.

If turned on, an additional field "Validation Configuration" comes up. Validation depends on the value in this field. The editor can add a regulare expression in this field. See http://html5pattern.com/ or http://bueltge.de/php-regular-expression-schnipsel/917/ for a lot of examples and an introduction to pattern. | `~https?://.+~`
=> An url with https beginning - https://www.test.org

`^[A-Za-z\u00C0-\u017F]+$`
=> letters with umlauts, accents and other special letters

`^[A-Za-z\s\u00C0-\u017F]+$`
=> letters with umlauts and space

`^[a-zA-Z][a-zA-Z0-9-_\.]{1,20}$`
=> letters/digits for a username with dash, underscore, point (1-20 signs)

`[0-9]{5}`
=> German ZIP Code (5 digits)

`\d+(,\d{2})?`
=> Price like 2,20 | No HTML5 type - type="text" is used |