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

Master Page readOnly or protected fields still open on page 2 of PDF

Avatar

Level 2

I have a flowable form that I have added some textfields to the Master Page in order to have them on every page.

I have set the fields to global binding so the form filler can access them from any page.  This works fine, the fields populate and the changes to the fields appear on every page.

The problem: I need to lock these fields after submit.

I have added the JavaScript found in the reference material to my submit button that finds and sets the access to all of the body page fields to "readOnly".  No problem with this script.

I am not an experienced JavaScript author, so to lock the fields on the master page, I set each field individually to "readOnly".

This works great on page 1 of the final PDF, the fields are locked.

On page 2, however, the fields are still accessible.  In fact, changing the values in the page 2 fields also change the values in the page 1 locked fields.

I have tried using the relative SOM as well as the absolute SOM for changing the property but no change in results.

I have also tried changing the property from "readOnly" to "protected" with no change in the results.

Can anyone tell me what I am doing wrong? 

1 Accepted Solution

Avatar

Correct answer by
Level 6

Hi,

Each master page has own number.

To lock second master page you have to access it properly, you try some script like this:

main.pageSet[0].yourMasterPageName[index].filedName.access = "readOnly"

index - index of master page starting from 0. In your case it shoul be 1.

Each master page has own number.

Best reagards,

Paul butenko

View solution in original post

3 Replies

Avatar

Correct answer by
Level 6

Hi,

Each master page has own number.

To lock second master page you have to access it properly, you try some script like this:

main.pageSet[0].yourMasterPageName[index].filedName.access = "readOnly"

index - index of master page starting from 0. In your case it shoul be 1.

Each master page has own number.

Best reagards,

Paul butenko

Avatar

Level 2

Thanks Paul,

I wish it was that easy.

I only have one Master Page for this form. 

The idea is the content could expand and force the form to flow to that second page, or in this case, I've added enough form fields to cause the form to flow to the next page.

I am including a sample form.  The text field at the top of the form is on the master page.  After hitting the submit button on the bottom of page 2, this form field will be readOnly, at least on page one.  If you look at the same field on the top of page two of the PDF, it will be open.

Ed

Avatar

Level 2

Paul,

I recind my previous reply.  It was that easy!

You have provided the answer I needed.

Thank very much,

Ed