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

Required Fields

Avatar

Level 1

How do I prevent someone from saving or printing a form unless all fields have been completed?

3 Replies

Avatar

Level 7

in your prePrint or preSave event do something like this


if(fieldsNotFilled)


{


    xfa.event.cancelAction = 1;


}


Avatar

Level 1

Thanks, but I can’t seem to find where I would put the code in.

Avatar

Level 7

Here is a trivial example. Note the use of JavaScript as the language

688739_pastedImage_0.png