Expand my Community achievements bar.

Lock down whole form except for a few buttons

Avatar

Level 3

Hi - I know this thread has been going on for a while (http://forums.adobe.com/thread/341252?start=150&tstart=0) but I really need a solution, and having tried to get something working using the advice is the above thread, I ended up with http://www.funkylogic.co.uk/lcqb53.pdf

This doesn't work - I have the code in as a variable, a button for lockdown at the bottom, and I want all the fields locked down except for the four buttons at the top of the form. With all the guru's on here, is there anyone who can help this noob - please.

7 Replies

Avatar

Level 10

You can use a for loop to lock all fields.

for (var i = 0; i < xfa.host.numPages; i++)

{

var oFields = xfa.layout.pageContent(i, "field&quot;);

var nNodesLength = oFields.length;

for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++)

   {

   oFields.item(nNodeCount).access = &quot;nonInteractive&quot;;

   }

}

}

Avatar

Level 3

Thanks - but where would I put this on the form that I posted earlier? Also, how would I exclude some fields?

Avatar

Level 10

You can put it in front of your saveAs script for example.

The script will only affect the fields on the body page, so the buttons that you placed on the master page will still work.

Avatar

Level 3

ah, but this form has fields on the master page too.

Avatar

Level 3

Sorry - still lost. I cannot get this to work, even on a new form with just a few

basic fields. I create a button, put your script on

the Click event, but still nothing in preview

Avatar

Level 4

Are all of the fields you need to lock in individual subforms?  If so, you could just do subform.access = "readOnly"; and that would lock everything in subform.

If you want to send me your simple form, I'll look at it and help you get a solution (alex.kloft@gmail.com)

Avatar

Level 3

Hi - my post says I do not want to lock all fields, and that should be a choice for the user. I have also already posted a link to the form. However, I have over 1000 forms to do this with, so the way I am going to do this is with signatures - there is a very simple way of allowing whatever you want to be locked down if the user chooses to lock down. IF they do not sign, the form is not locked down. All much easier than scripting myself - I am using Livecycle ES2 9.0, if that makes any difference to the available tools.