Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Use type="number" for validation min and max #695

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class FieldTypeFromValidationViewHelper extends AbstractValidationViewHelper
2 => 'url',
3 => 'tel',
4 => 'number',
6 => 'number',
7 => 'number',
8 => 'range',
];

Expand Down
4 changes: 2 additions & 2 deletions Documentation/ForEditors/FieldInput.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Administrator can enable or disable the validation in general with TypoScript (s
| Phone | If turned on, visitor must leave a string with a phone syntax. | 01234567890<br>0123 4567890<br>0123 456 789<br>(0123) 45678 - 90<br>0012 345 678 9012<br>0012 (0)345 / 67890 - 12<br>+123456789012<br>+12 345 678 9012<br>+12 3456 7890123<br>+49 (0) 123 3456789<br>+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<br>68465135135135185 | input with type="number" is used if HTML5-Validation is turned on.<br><br>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<br>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.<br>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<br>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.<br><br>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<br>123 => 122 or 100 or 10 or less | 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.<br>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<br>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.<br><br>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<br>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.<br><br>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<br>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.<br><br>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<br>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.<br><br>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?://.+~`<br>=> An url with https beginning - https://www.test.org<br><br>`^[A-Za-z\u00C0-\u017F]+$`<br>=> letters with umlauts, accents and other special letters<br><br>`^[A-Za-z\s\u00C0-\u017F]+$`<br>=> letters with umlauts and space<br><br>`^[a-zA-Z][a-zA-Z0-9-_\.]{1,20}$`<br>=> letters/digits for a username with dash, underscore, point (1-20 signs)<br><br>`[0-9]{5}`<br>=> German ZIP Code (5 digits)<br><br>`\d+(,\d{2})?`<br>=> Price like 2,20 | No HTML5 type - type="text" is used |
Loading