Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!

Conditional fields not displaying after closing & reopening form

Avatar

Level 1

Hi there,

I've created a PDF form using LiveCycle Designer, which has conditional fields which appear based on the user's response to other questions. My conditional formatting is working fine and the correct additional fields are being displayed based on the user selections.

However, if I add some information into one of the conditional fields once it's made visible, when I save & close the form, on reopening the form, the conditional fields are no longer displayed. If I re-select the item to make the conditional field display (eg, the field will already have "yes" in the field but if I select "yes" again), it shows up, and the information previously entered is still there.

Does anyone know why this may be happening and what I can do to make the fields stay visible? I have also tried using a 'lock all fields' button - which works, but again on saving, closing & reopening the form, the fields are no longer locked.

Thank you in advance!

4 Replies

Avatar

Level 10

I think you use the click:Event of a checkbox or so to change the visibility.

This event only executes during runtime.

When the form is reopened Acrobat/Reader renders the form by the template made with Designer, where the fields is initally invisible/hidden.

As you're click:Event does not fire during this process the fields stays invisible/hidden.

You need another event, which will cover this purpose such as layout:Ready.

Avatar

Level 1

Thanks radzmar,

So would I need to rescript my events, or add a button (something like 'finalise form') when the form is filled out to activate the layout: ready event?

Thanks very much

Avatar

Level 10

The layoutReady:Event is always active.

What script do you use actually to show/hide your fields and in what event?

Avatar

Level 1

Hi again & apologies in the delay in my response.

Here's an example of the script I've used both visibility of specific fields and also subforms - I found this script easier as I often have questions which, depending on the answer, will require different fields to be visible. In all cases the script is located on the "change" event.

form1.S2.ScanningSubform.ScanToEmail.presence = "hidden";
form1.S2.ScanningSubform.ScanToOther.presence = "hidden";


switch (xfa.event.newText){
    case "Emailed":
          form1.S2.ScanningSubform.ScanToEmail.presence = "visible";
          break;


    case "Other":
          form1.S2.ScanningSubform.ScanToOther.presence = "visible";
          break;
          }

Thankyou for your help - much appreciated!