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

execValidate, but silently? (no validation/empty message boxes!!)

Avatar

Level 2

Hi All

I want to check if all fields are valid and filled in.

I use execValidate().

However, executing execValidate means all the validation script messages and empty messages are also displayed.

Is there any way of checking for validity, but without the annoying message boxes popping up?

Thanks,

Shiv

4 Replies

Avatar

Former Community Member

Hi shiv,

I'm facing the same issue here ... Did you find a solution or a workaround for your problem ?

Regards,

Thomas

Avatar

Level 10

Hi,

LC Designer ES2 (version 9) and ADEP Designer (version 10) have better means of controlling validation. I would recommend upgrading. However please note it will means that your users will have to be using Acrobat/Reader version 9.1 or later.

Niall

Avatar

Former Community Member

Hi Niall,

Thanks for your response, but I'm already using LC Designer ES2, and my form target is Adobe Reader 9.1.

I have a hidden boolean inside my form that I use in the following way :

On the preSave event, I put the execValidate() result in my boolean to know if the form is "valid" or not. The form is filled in a "disconnected" mode, so there is no submit button, etc.

What I want is the "execValidate()" to be silent for the user, so that I can have the info without any popup.

However, I need those pop-up because there is a button "validate form" which is for the user, and i need custom warnings for some fields.

Regards,

Thomas

Avatar

Former Community Member

Hi all,

I finally found a simple way to do this :

I programatically change the validationMessaging config at runtime, ie on the preSave event :

1. deactivate warnings

2. execValidate()

3. reactivate warnings

The javascript code to change this value is :

1. config.acrobat.common.validationMessaging.value = "noMessages"; (No messages will be displayed at all)

3. config.acrobat.common.validationMessaging.value = "allMessagesTogether"; (All messages are grouped together inside one popup)

Hope this helps,

Regards,

Thomas