### `AbstractNumericFormField`
`AbstractNumericFormField` is the abstract implementation of a form field handling a single numeric value.
-The class implements `IAttributeFormField`, `IAutoCompleteFormField`, `IImmutableFormField`, `IInputModeFormField`, `IMaximumFormField`, `IMinimumFormField`, `INullableFormField`, `IPlaceholderFormField` and `ISuffixedFormField`.
+The class implements `IAttributeFormField`, `IAutoCompleteFormField`, `ICssClassFormField`, `IImmutableFormField`, `IInputModeFormField`, `IMaximumFormField`, `IMinimumFormField`, `INullableFormField`, `IPlaceholderFormField` and `ISuffixedFormField`.
If the property `$integerValues` is `true`, the form field works with integer values, otherwise it works with floating point numbers.
The methods `step($step = null)` and `getStep()` can be used to set and get the step attribute of the `input` element.
The default step for form fields with integer values is `1`.
`BooleanFormField` is used for boolean (`0` or `1`, `yes` or `no`) values.
Objects of this class require a label.
The return value of `getSaveValue()` is the integer representation of the boolean value, i.e. `0` or `1`.
-The class implements `IAttributeFormField`, `IAutoFocusFormField`, and `IImmutableFormField`.
+The class implements `IAttributeFormField`, `IAutoFocusFormField`, `ICssClassFormField`, and `IImmutableFormField`.
### `CheckboxFormField`
### `DateFormField`
`DateFormField` is a form field to enter a date (and optionally a time).
-The class implements `IAttributeFormField`, `IAutoFocusFormField`, `IImmutableFormField`, and `INullableFormField`.
+The class implements `IAttributeFormField`, `IAutoFocusFormField`, `ICssClassFormField`, `IImmutableFormField`, and `INullableFormField`.
The following methods are specific to this form field class:
- `earliestDate($earliestDate)` and `getEarliestDate()` can be used to get and set the earliest selectable/valid date and `latestDate($latestDate)` and `getLatestDate()` can be used to get and set the latest selectable/valid date.
### `ItemListFormField`
`ItemListFormField` is a form field in which multiple values can be entered and returned in different formats as save value.
-The class implements `IAttributeFormField`, `IAutoFocusFormField`, `IImmutableFormField`, and `IMultipleFormField`.
+The class implements `IAttributeFormField`, `IAutoFocusFormField`, `ICssClassFormField`, `IImmutableFormField`, and `IMultipleFormField`.
The `saveValueType($saveValueType)` and `getSaveValueType()` methods are specific to this form field class and determine the format of the save value.
The following save value types are supported:
### `MultipleSelectionFormField`
`MultipleSelectionFormField` is a form fields that allows the selection of multiple options out of a predefined list of available options.
-The class implements `IAttributeFormField`, `IFilterableSelectionFormField`, `IImmutableFormField`, and `INullableFormField`.
+The class implements `IAttributeFormField`, `ICssClassFormField`, `IFilterableSelectionFormField`, `IImmutableFormField`, and `INullableFormField`.
If the field is nullable and no option is selected, `null` is returned as the save value.
### `RadioButtonFormField`
`RadioButtonFormField` is a form fields that allows the selection of a single option out of a predefined list of available options using radiobuttons.
-The class implements `IAttributeFormField`, `IImmutableFormField`, and `ISelectionFormField`.
+The class implements `IAttributeFormField`, `ICssClassFormField`, `IImmutableFormField`, and `ISelectionFormField`.
### `RatingFormField`
### `SingleSelectionFormField`
`SingleSelectionFormField` is a form fields that allows the selection of a single option out of a predefined list of available options.
-The class implements `IFilterableSelectionFormField`, `IImmutableFormField`, and `INullableFormField`.
+The class implements `ICssClassFormField`, `IFilterableSelectionFormField`, `IImmutableFormField`, and `INullableFormField`.
If the field is nullable and the current form field value is considered `empty` by PHP, `null` is returned as the save value.
### `TextFormField`
`TextFormField` is a form field that allows entering a single line of text.
-The class implements `IAttributeFormField`, `IAutoCompleteFormField`, `IImmutableFormField`, `II18nFormField`, `IInputModeFormField`, `IMaximumLengthFormField`, `IMinimumLengthFormField`, `IPatternFormField`, and `IPlaceholderFormField`.
+The class implements `IAttributeFormField`, `IAutoCompleteFormField`, `ICssClassFormField`, `IImmutableFormField`, `II18nFormField`, `IInputModeFormField`, `IMaximumLengthFormField`, `IMinimumLengthFormField`, `IPatternFormField`, and `IPlaceholderFormField`.
### `TitleFormField`
Instead, the dedicated API provided by the relevant interface has to be used.
-
#### `IAutoCompleteFormField`
!!! info "Only available since version 5.4."
`TAutoFocusFormField` provides a default implementation of these two methods.
+#### `ICssClassFormField`
+
+!!! info "Only available since version 5.4."
+
+`ICssClassFormField` has to be implemented by form fields for which CSS classes can be added to the actual form element (in addition to adding CSS classes to the surrounding element via the class-related methods of `IFormNode`).
+The implementing class has to implement the methods `addFieldClass(string $class): self`/`addFieldClasses(array $classes): self` and `getFieldClasses(): array`, which are used to add and get the CSS classes, respectively.
+Additionally, `hasFieldClass(string $class): bool` has to implemented to check if a certain CSS class is present and `removeFieldClass(string $class): self` to remove a CSS class.
+`TCssClassFormField` provides a default implementation of these methods.
+
+
#### `IFileFormField`
`IFileFormField` has to be implemented by every form field that uploads files so that the `enctype` attribute of the form document is `multipart/form-data` (see `IFormDocument::getEnctype()`).