The type “input” generates an
<input> field, possibly with additional
- Abstract value for the width of the
<input>field. To set the input field to the full width of the form area, use the value 48. Default is 30.
Value for the “maxlength” attribute of the
If the form element edits a varchar(40) field in the database you should also set this value to 40.
- list of keywords
Configuration of field evaluation.
The evaluation functions will be executed in the list-order.
- Allows only a-zA-Z characters.
- Same as “alpha” but allows also “0-9”
- Same as “alphanum” but allows also “_” and “-” chars.
- The field will evaluate the input as a date, automatically converting the input to a UNIX-time in seconds. The display will be like “12-8-2003” while the database value stored will be “1060639200”.
- The field will evaluate the input as a date with time (detailed to hours and minutes), automatically converting the input to a UNIX-time in seconds. The display will be like “16:32 12-8-2003” while the database value will be “1060698720”.
- Allows a domain name such as
example.organd automatically transforms the value to punicode if needed.
- Converts the input to a floating point with 2 decimal positions, using the “.” (period) as the decimal delimited (accepts also “,” for the same).
- This type adds a server-side validation of an email address. If the input does not contain a valid email address, a flash message warning will be displayed.
- Evaluates the input to an integer.
- Will filter out any character in the input string which is not found in the string entered in the key “is_in” (see below).
- Converts the string to lowercase (only A-Z plus a selected set of Western European special chars).
MD5()function is found in
- Removes all occurrences of space characters (
- An empty value (string) will be stored as
NULLin the database. (requires a proper sql definition)
- Allows only 0-9 characters in the field.
- Will show “*******” in the field after entering the value and moving to another field. Thus passwords can be protected from display in the field.
The value is visible while it is being entered!
- A non-empty value is required in the field (otherwise the form cannot be saved).
- The field will evaluate the input as a timestamp in seconds for the current day (with a precision of minutes). The display will be like “23:45” while the database will be “85500”.
- The field will evaluate the input as a timestamp in seconds for the current day (with a precision of seconds). The display will be like “23:45:13” while the database will be “85513”.
- The value in the field will have white spaces around it trimmed away.
Requires the field to be unique for the whole table. (Evaluated on the server only).
When selecting on unique-fields, make sure to select using
AND pid>=0since the field can contain duplicate values in other versions of records (always having PID = -1). This also means that if you are using versioning on a table where the unique-feature is used you cannot set the field to be truly unique in the database either!
- Requires the field to be unique for the current PID (among other records on the same page). (Evaluated on the server only).
- Converts to uppercase (only A-Z plus a selected set of Western European special chars).
- Evaluates the input to a year between 1970 and 2038. If you need any year, then use “int” evaluation instead.
- User defined form evaluations. See below.
“(TCE)” means the evaluation is done in the TCE on the server. The class used for this is
Setting the field to evaluate the input to a date returned to the database in UNIX-time (seconds):'eval' => 'date',
Trimming the value for white space before storing in the database (important for varchar fields!):'eval' => 'trim',
By this configuration the field will be stripped for any space characters, converted to lowercase, only accepted if filled in and on the server the value is required to be unique for all records from this table:'eval' => 'nospace,lower,unique,required'
- User-defined form evaluations:
returnFieldJS()and two for the server side:
deevaluateFieldValue()called when opening the record and
evaluateFieldValue()called for validation when saving the record.
// Register the class to be available in 'eval' of TCA $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals']['Vendor\\Extension\\Evaluation\\ExampleEvaluation'] = '';
'columns' => [ 'example_field' => [ 'config' => [ 'type' => 'input', 'eval' => 'trim,Vendor\\Extension\\Evaluation\\ExampleEvaluation,required' ] ], ],
- Display / Proc.
- string (keyword)
When an input-type field is set as read-only, it actually gets rendered as a none-type field. This means that is is possible to use the format property of such field to format the value of the input-type field.
Read-only fields with
evalset to “date” will be formatted as “date”, “datetime” as “datetime” and “time” as “time”. This overrides any value of
formatwhich might have been set.
- string, allowed values: ‘rsaInput’
- Adds RSA encryption to a field prior to being submitted
- If the evaluation type “is_in” (see eval) is used for evaluation, then the characters in the input string should be found in this string as well. This value is also passed as argument to the evaluation function if a user-defined evaluation function is registered.
- Display / Proc.
- This setting is not used anymore since TYPO3 CMS 4.5.
- Display / Proc.
- An array which defines an integer range within which the value must be.
Values for Key:
- Defines the lower integer value.
- Defines the upper integer value.
You can specify both or only one of them.
This feature is evaluated on the server only so any regulation of the value will have happened after saving the form.
Limit an integer to be within the range 10 to 1000:
'eval' => 'int', 'range' => array( 'lower' => 10, 'upper' => 1000 ),
In this example the upper limit is set to the last day in year 2020 while the lowest possible value is set to the date of yesterday:
'range' => array( 'upper' => mktime(0, 0, 0, 12, 31, 2020), 'lower' => mktime(0,0,0,date('m'), date('d'), date('Y')) )
- Disable the display of the age (p.e. “2015-08-30 (-27 days)”) of
date fields. It will be respected if the field has the type
inputand its eval is set to
- Controls the
autocompleteattribute of a given input field
'title' => array( 'exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.title', 'config' => array( 'type' => 'input', 'size' => '20', 'eval' => 'null', 'autocomplete' => false, ) ),
(Since TYPO3 CMS 4.7)
Placeholder text for the input field. This can be a simple string or a reference to a value in the current record or another one. With a syntax like
__row|fieldthe placeholder will take the value of the given field from the current record.
Since TYPO3 CMS 6.2, this can be recursive. If the designated field is a relation to another table (i.e. is of type select, group or inline), the related record will be loaded and the placeholder searched within it.
Taken from the “sys_file_reference” table.
'title' => array( 'l10n_mode' => 'mergeIfNotBlank', 'exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.title', 'config' => array( 'type' => 'input', 'size' => '20', 'eval' => 'null', 'placeholder' => '__row|uid_local|metadata|title', 'mode' => 'useOrOverridePlaceholder', ) ),
In the above placeholder syntax,
uid_local points to the
related “sys_file” record and
metadata points to the
“sys_file_metata” of the related “sys_file” record. From there we
take the content of the
- string (keywords)
(Since TYPO3 CMS 6.0)
This property is related to the placeholder property. When defined a checkbox will appear above the field. If that box is checked, the field can be used to enter whatever the user wants as usual. If the box is not checked, the field becomes read-only and the value saved to the database will be
What impact this has in the frontend depends on what is done in the code using this field. In the case of FAL relations, for example, if the “title” field has its box checked, the “title” from the related metadata will be provided.
For example code, see the placeholder property.
This is how the mode checkbox appears in the TYPO3 CMS backend:
In order for this property to apply properly, the field must be allowed to use “null” as a value (i.e the eval property must list “null” as a possible evaluation.
- Display / Proc.
- See the wizards section for more information.
(Since TYPO3 CMS 6.0)
This field is only relevant when storing date or datetime values as Date or Datetime type in the database instead of an integer value.
When a model property is defined to be of type DateTime (PHP) and it is meant to be stored as a Date or Datetime type (for example like in MySQL) in the database, one has to set eval to date/datetime and additionally set the field dbType as well.
CREATE TABLE tx_example_domain_model_foo ( synced_at datetime default NULL )
'synced_at' => array( 'config' => array( 'type' => 'input', 'eval' => 'datetime', 'dbType' => 'datetime' ) ),
A “date” field¶
This is the typical configuration for a date field, like “starttime”:
'starttime' => array( 'exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.starttime', 'config' => array( 'type' => 'input', 'size' => '13', 'max' => '20', 'eval' => 'datetime', 'default' => '0' ), 'l10n_mode' => 'exclude', 'l10n_display' => 'defaultAsReadonly' ),
A “username” field¶
In this example the field is for entering a username (from “fe_users”). A number of requirements are imposed onto the field, namely that it must be unique within the page where the record is stored, must be in lowercase and without spaces in it:
'username' => array( 'label' => 'LLL:EXT:cms/locallang_tca.xlf:fe_users.username', 'config' => array( 'type' => 'input', 'size' => '20', 'max' => '50', 'eval' => 'nospace,lower,uniqueInPid,required' ) ),
A typical input field¶
This is just a very typical configuration which sets the size and a character limit to the field. In addition the input value is trimmed for surrounding whitespace which is a very good idea when you enter values into varchar fields:
'name' => array( 'exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.name', 'config' => array( 'type' => 'input', 'size' => '40', 'eval' => 'trim', 'max' => '80' ) ),
Here the field is required to be filled in:
'title' => array( 'label' => 'LLL:EXT:cms/locallang_tca.xlf:fe_groups.title', 'config' => array( 'type' => 'input', 'size' => '20', 'max' => '50', 'eval' => 'trim,required' ) ),