Expand my Community achievements bar.

SOLVED

Disable all fields, except one button, in an Interactive form.

Avatar

Former Community Member

Hi,

I can successfully disable all form fields in an ES2 form with a button and Javascript, however, I would like to leave one password protected button "open" so certain users can unlock the form if required.

The code used is:

xfa.form.form1.access = "nonInteractive";

xfa.form.form1.page1.UnlockButton.access = "open";

I am guessing that once the first line of code executes, the second line is ignored. Any wisdom would be welcomed.

Thanks,

Ron

1 Accepted Solution

Avatar

Correct answer by
Level 7

Hi,

You can use a script that uses

yourSubformName.access = "protected";          

on each of your Subforms. This still lets users copy to their clipboard and paste in another application.

On the Subform that contains the unlocked field or button you'll need to

yourFieldName.access = "protected;

on each sibling field in that particular parent that contains the unlocked button/field..

I do this and have a field that has no borders or caption to indicate that it exists (invisible, so to speak). If a user (Administrator) knows where the field is they can enter the secret word and unlock the form with a script using .access = "open"  on all the objects you locked.  You can leave a button unlocked instead. You can also style a button so it can't be seen, too.

There are probably other ways to do it--but this works for me.

Good luck,

Stephen

View solution in original post

1 Reply

Avatar

Correct answer by
Level 7

Hi,

You can use a script that uses

yourSubformName.access = "protected";          

on each of your Subforms. This still lets users copy to their clipboard and paste in another application.

On the Subform that contains the unlocked field or button you'll need to

yourFieldName.access = "protected;

on each sibling field in that particular parent that contains the unlocked button/field..

I do this and have a field that has no borders or caption to indicate that it exists (invisible, so to speak). If a user (Administrator) knows where the field is they can enter the secret word and unlock the form with a script using .access = "open"  on all the objects you locked.  You can leave a button unlocked instead. You can also style a button so it can't be seen, too.

There are probably other ways to do it--but this works for me.

Good luck,

Stephen