Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Validating Fields

Avatar

Former Community Member
The first field on my form is a required text field. When I Preview PDF and hit the submit button I get the default error message.

I would like the form to display the Empty Message instead. How do I do that. JavaScript?
3 Replies

Avatar

Former Community Member
The empty message field doesn't work as you expect. The empty field message will only be displayed if you enter data into the field - leave it, then come back and remove the data. Then your message will be displayed. Otherwise the validation message will be displayed.

Avatar

Former Community Member
If I want a message to display when the user clicks submit, I need to write JavaScript to handle that?

Avatar

Former Community Member
You can write script on the validate event of the field and if you return true or false the message will appear but I think the generic message will always appear whether there is 1 field validation problem or more than 1.