Customizing the position of error messages
To customize the position of the error message, add a <div> tag for each error and warning field, position the <div> tag on the left or right, and apply css styles on the <div> tag. For detailed steps, see the procedure listed below:
-
Navigate to the
CustomErrorManager-1.0-SNAPSHOTfolder and open theetc\clientlibs\mf-custom-error-manager\CustomErrorManager\javascriptfolder. -
Open the
customErrorManager.jsfile for editing. ThemarkErrorfunction in the file accepts the following parameters:jqWidget jqWidget is the handle for a widget. msg contains the error message type denotes whether it is an error or warning -
On the out of the box implementation, error messages appears on the right of the field. To make the error messages appear on the top use the following code.
-
Save and close the file.
-
Navigate to the
CustomErrorManager-1.0-SNAPSHOTfolder and create an archive of jcr_root and META-INF folders. Rename the archive to CustomErrorManager-1.0-SNAPSHOT.zip. -
Use the Package Manager to upload and install the package.
Display error messages for multiple fields
Ue the attached package to simultaneously display error messages for all the fields. To display a single error message, use the default profile.
Customizing the appearance of error messages.
-
Navigate to the etc\clientlibs\mf-custom-error-manager\CustomErrorManager\css folder.
-
Open the file sample.css for editing. The css file contains 2 ids- #customError, #customWarning. You can use these ids to change various properties such as color and font size.
Use the following code to change the font size and color of error/warning messages.
-
Save and close the file.
-
Navigate to the CustomErrorManager-1.0-SNAPSHOT folder and create an archive of jcr_root and META-INF folders. Rename the archive to CustomErrorManager-1.0-SNAPSHOT.zip.
-
Use the Package Manager to upload and install the package.
Render the form with the new profile.
Out of the box, html5 forms use a default profile: https://<server>/content/xfaforms/profiles/default.html?contentRoot=<xdp location>&template=<name of the xdp>
To view a form with the custom error messages, render the form with error profile: https://<server>/content/xfaforms/profiles/error.html?contentRoot=<xdp location>&template=<name of the xdp>
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.