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.

Form saves ok and locks fields. Although, field missing on re-open

Avatar

Former Community Member

Hi there,

I have been working on this form for a while now. (http://www.sigmastudies.co.uk/downloads/booking_form.pdf)

So that you can see:

  • Select Private individual
  • Select ADR (Hazardous Goods) course
  • Scroll down and select the "Other" radio field (at the bottom under Course Description green heading)

This then eventually brings up a couple of read-only fields.

Click the "SAVE" button at the bottom of the page and the form eventually SAVES (after you choose where) and Locks fields.

NOTICE how the newly visible "Course Decription" and "Total" read-only fields that you got from clicking "Other" are obiously still showing.

NOW HERES THE PROBLEM

If you then close the form and reopen the locked form where you saved it, the 'Course Description" and "Total" fields are gone.

Can someone pleeeeease shed some light on this. Is it some glitch in the LockAllfields variable.

I appriciate all your help

Will

4 Replies

Avatar

Level 10

Hi Will,

Try going to the File > Form Properties > Defaults tab and make sure that "preserve script changes" is set to Automatic:

Preserve script changes.png

Hope that helps,

Niall

Assure Dynamics

Avatar

Former Community Member

Hi Niall,

Tried what you said and the settings are indeed set to Automatic preserve script changes.

Any other ideas.

Appreciate the help

Thanks

Will

Avatar

Level 2

Hi Will

The visible state of elements in dynamic forms is not guaranteed to be saved, you should set this up as part of the form initialisation.

Each element that has dynamic visibility must have some data element that is saved for it, in your case, the Radio Button.

Use the Initialise or Form Ready event, to make sure the data is loaded, and if is it "Other", then display the Course subform.

P.S. Some people prefer to add/remove instances of subforms, rather than use show/hide.

Hope this helps.

Avatar

Former Community Member

Brilliant!!!

Thanks for your help.

Found a workarond last night by wrapping the two fields into a subform.

Although i think your solution is more reliable and will add this is future updates of the form.

Thanks for shedding some light on things

Will

Sent from my iPhone