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.

Creating password protected text fields

Avatar

Former Community Member
Hello, I need to make a form that if a password is entered, all text fields are available to be filled out and if no password is entered, then only a few chosen text fields can be filled out. I have searched many places and have come close to the answer but have still fallen short of my goal.



thank you
3 Replies

Avatar

Level 5
Here is one example to look at...



You can use this on a click of a button.

//JavaScript

var pWord = "AbCdEf" //set your password

var requestpWord = xfa.host.response("Please enter your password.")

if (pWord == requestpWord) {

this.presence = "hidden"; //hide this button

//write your code to enable all the text fields

}else {

//write your code to enable only fields tha you want.

}

Avatar

Former Community Member
Thank you so much.

It solved my problem, although when i open the document all the fields are still fillable because the document remembers my password. How can i make it so that each time i open the document it does not remember the password?



Thanks again