Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Different validations in a print button -- Urgent !


Not applicable

I've adopted the script stated in HightlightOneRequiredField.pdf so that the print button in my form can detect and prevent null field before pop up the print dialog.

However, there's an email field (in my form) with a validate event, i.e. to validate if the email address is in general format "", which I want the same print button to check this email validation too (apart from the normal null field checking)

In other words, what I want is that the print button will check:

1) when a null field is detected, then pop up alert message and disable print and;

2) when a field with validate event scripted is detected, and if its validation is not passed, then pop up its existing validation error message, then disable print

Can someone help on this ?

Thanks in advance.

4 Replies


Level 6
Hi Alex,


This will check all validations on your form, display the error message for each, and return true or false. True if all validations pass and false otherwise. Use this in your print button to check the validations before printing. So. . .

if (xfa.form.execValidate()) yada);

A word of caution though. I don't think this is fool-proof. A user can always print using the menu or a shortcut key in Acrobat/Reader, which bypasses your print button.

Hope this helps.

Jared Langdon


Not applicable
Hi Jared Langdon

thanks a lot !!!

I'll try this now !