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

mandatory field

Avatar

Former Community Member

Hi,

Is there a way to set a field in a form that unless they fill out that field they cannot fill out the rest of the form?

Thanks!!!

1 Reply

Avatar

Level 2

2 ways of doing this:

  1. You make the rest of the fields wrapped in a subform and then set visibility of the subform so that only when field is non-empty the subform is visible, by setting property :
    • Subform.presence="visible".
  2. You can set the access levels of the fields initially to protected and later only in case field is non-null enable users to edit the fields, using the access property:
    • TextField.access="open";           //"open" to unprotect the fields