Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
krish469
Contributor


Summary:  Password protection for Adobe Form with Java Script

Approach:

1.Go to Transaction SFP

2. Create a form

3. Go to Layout and create a text on Master page as shown below

4. Create Password check for adobe form

->Go to the Initialize event of DATA as shown below

->Write down below code


//Decalre variables
var a=1;
var b=2;
var password;


//Prompt for password from user to open the adobe form
password = xfa.host.response("Enter the Password","The title","123");

//Check for Correct password
{
if (password == "123")    // In this case Password id hard coded to 123
{
  xfa.host.messageBox("Right password","You Know right",3,0);
  a = 1;
  b = 1;
}
else
{
  xfa.host.messageBox("Wrong password","You know ur Wrong",1,1);
  a = 1;
  b = 2;
  password = xfa.host.response("Enter the Password","The title","123");
}
}
while( a != b );

5. Now execute the form

  -> Do not forget the mark Fillable of Form I/P as 'X'

and execute.

Now, Adobe form will ask for password as shown below

Till correct password is enetered this pop up will appear. We can download this form and try to open still password protection will be vaild.

Drawbacks:

->Password is harcoded, I do not how to check with an value from table or rule dynamically

->I ain't any good in Java scipt, hence could not hide password ( genrally it works with form calc)

11 Comments