Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

validate.nullTest working only with the EMAIL button


Former Community Member

This piece of code is working just great when submiting a form by


TextField1.validate.nullTest = "error"; (highlighting the empty fields when pushing the EMAIL button)

On the print button it doesn't have any effect. How can I highlight

the required fields when clicking the print button the same easy way

as with the email button? (I have other highlighting scripts but I want to use the exact same method as used on EMAIL)

Your input is really appreciated! And any explanations for this stupid behavior?
1 Reply


Former Community Member
To make this functionality you can use two buttons trick:

First button Print, onClick event should has this script: realPrintButton.execEvent("click").

Second button is invisble Print button.

So, when you click on your first button print validation is appear and real print will be executed.