Field element
The field element contains two nested elements: widget and caption.
Widget element
The widget element contains the user interface element for interaction with users. It has three CSS classes:
- Widget: Every widget has this class.
- name: All the widgets shipped with AEM contain the widget name class. For custom widgets, the widget developer provides the Widget name class.
- type: Every widget has a user interface element. This class defines the type of the user interface element.
Besides the type and name class, the field component also contains an additional CSS class named subtype. A subtype identifies which type of field it is, for example, NumericField, DateField, TextField. You can override the subtype class to modify the styling of all the fields of type, subtype.
CSS classes for different components
CSS classes for different Fields
The AEM Forms Designer supports different types of fields in a form like NumericField, DecimalField, and Date Field. All of these fields in HTML contain the above mentioned CSS classes. They also contain some extra classes depending on the type of field.
Every field has an associated widget representing the UI element. The classes of each field and the widgets associated with each field are listed below.
CSS classes for different Draw Elements
You can insert static draw elements like text, and images, using the AEM Forms Designer. For each draw element, a separate CSS class is associated with that element. The list of CSS classes for draw elements is listed below. Every draw element has a draw class associated with it.
| Draw Type | CSS class |
|---|---|
| Text | text |
| Image | image |
| Rectangle | rectangle |
| Line | line |
Styling other parts of the form
Besides the appearance of UI components in the HTML form, you can change the style of elements like Inline Errors, Inline Warnings, and fields with validation errors.
Styling Inline Errors
When the validation of a field results in an error, an inline error is displayed when the field in active. To change the style of inline errors, override the CSS ID error-msg.
Styling Inline Warnings
When the validation of a field results in a warning, an inline warning is displayed when the field is active. To change the style of these inline warnings, override the CSS ID warning-msg.
Styling Fields with Validation Errors
When validation for a field fails, the style of the widget changes. This style change is done by applying a CSS class widgetError on the widget component. To modify the default styling, override the widgetError class.
Was this content helpful?
Announcements
Get hands-on with agentic AI.
Explore how AI agents work together through real examples and hands-on practice. Join your local User Group to design an agent workflow with your peers and leave with a practical framework you can apply to your own work.
Find an eventAdobe Experience Manager Roadmap Webinar, Part 2 (Forms, Cloud & Managed Services) - Americas & EMEA
Preview the AEM Forms, Cloud, and Managed Services roadmap. Ask the team live.
Adobe Experience Manager Roadmap Webinar, Part 2 (Forms, Cloud & Managed Services) - Americas & APAC
Preview the AEM Forms, Cloud, and Managed Services roadmap. Ask the team live.