Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Disappearing Subform

Avatar

Level 2

I've created an interactive dynamic form that shows or hides subforms based on

a selection from a drop-down menu.


The drop-down menu has 10 "List Items" and each List Item has a corresponding subform.

Each subforms presence set to "Hidden (Exclude from Layout)."
The subforms are made "visible" or "hidden" using the following JavaScript:

if ("RMC-Guernsey-PLD DOT" == xfa.event.newText)

{
    GU_ML.presence = "visible";
}
else
{
    GU_ML.presence = "hidden";
    GU_ML.rawValue = "";
}

This script is repeated 10 times, once for each list item and subform.
The form fields are locked via a digital signature and the form is submitted as a PDF using an e-mail submit button.

At this point everything looks fine.

The problem is when the form is re-opened. The subform made visible from the drop-down menu is no longer

visible, but is hidden and excluded from the layout.

How do I keep the subform visible?

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

On the form properties page under the Defaults Tab make sure that the option to preserve script changes is set to automatic and not manual.

Paul

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

On the form properties page under the Defaults Tab make sure that the option to preserve script changes is set to automatic and not manual.

Paul

Avatar

Level 2

It worked!

Thanks.....I never would have thought to look under the form properties.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----