Actions
Task #69396
closedForms: validation of SELECT element
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2015-08-28
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Sprint Focus:
Description
Originally reported in #45605.
Mandatory for select-boxes: this validation ALWAYS succeeds because it is not possible to add an empty select-option.
Updated by Björn Jacob about 9 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
This can be achieved easily using e.g. the alphabetic validator. See the following example:
enctype = multipart/form-data method = post prefix = tx_form confirmation = 1 prefix = formPid7 class = formPid7 10 = SELECT 10 { label = Select name = select 10 = OPTION 10 { data = } 20 = OPTION 20 { data = Mr value = Mr } 30 = OPTION 30 { data = Mrs value = Mrs } } 20 = SUBMIT 20 { name = submit } rules { 1 = alphabetic 1 { element = select message = This field is mandatory. error = Please choose an option. } }
Actions