Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Trouble with mandatory fields in subforms with .presence = "inactive";

Avatar

Level 1

Hello all.

For the past few weeks I have been building a form. In this form are fields which are mandatory, but that are in inside optional subforms - that is, if that subform is not in use, the fields within are not required.

I have set the parent subform's presence to "inactive", but the fields within that subform still cause mandatory field errors when submitting the form as a PDF by email. The target version is set acrobat reader 9.1 or later.

Any help would be massively appreciated.

1 Accepted Solution

Avatar

Correct answer by
Level 1

For anyone who has the same issue, I did finally get the form working.

I basically copied all the subforms into a completely new form. This fixed the inactive presence issue, but broke validation after the first radio field.

To fix the radio field issue I had to change the Adobe reader target version: "File -> form properties -> defaults" and set the target version to "Acrobat and Adobe Reader 9.1 or later".

View solution in original post

3 Replies

Avatar

Level 2

Hi, it looks like you need to modify the scripts controlling the optional subforms appearance. When your logic shows the subform, make your fields in this subform required by adding something like

Field.mandatory = "error"; - to make mandatory

when your condition is hiding the subform, add

Field.mandatory = "disabled"; - to make optional

I hope it helps.

Avatar

Level 1

While that would work, it would take a very long time, and the logic would not be simple - some subforms have a mixture of required and non-required fields that also change depending on other selections within that form. Hiding and reshowing subform would break it. The .presence = "inactive" is exactly what is needed here, but for some reason, does not work.

Avatar

Correct answer by
Level 1

For anyone who has the same issue, I did finally get the form working.

I basically copied all the subforms into a completely new form. This fixed the inactive presence issue, but broke validation after the first radio field.

To fix the radio field issue I had to change the Adobe reader target version: "File -> form properties -> defaults" and set the target version to "Acrobat and Adobe Reader 9.1 or later".