These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Using a button to prompt for a password

gaidheal
Registered: Feb 8 2010
Posts: 14

I have a form that is protected with a password so that the field data cannot be entered/modified unless the password is entered. I want to make it easier for the user to enter the password, so I created a button that will prompt for the password, and found a post elsewhere on this site that dealt with a similar issue.

Using the code sample from that post, I opened up the javascript editor and entered the following:
var pWd = app.response("Please enter Password","Document Control Only")

Then I tested that piece by going to the preview mode and clicking on the button. The problem is that nothing happens. The button depresses, but nothing happens, no prompt.

I notice that in the button properties there are three control types: Regular, Execute and Submit. I'm not clear on what the difference is betwwn Regular and Execute, and the default seems to be Regular. Thinking it might need to be on Execute, but when I change to Execute and save, it goes back to Regular.

What am I doing wrong? Any assistance would be greatly appreciated.

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

read this thread.

[url]http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=22940[/url]

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

gaidheal
Registered: Feb 8 2010
Posts: 14
I had seen that post before, and had tried the code you listed. I got the same non-result as with the other code I had used. When I open the form and click on the button, the button highlights from the click, but nothing else happens.
Is there something that needs to be enabled that I haven't done? What is the difference in the properties of Regular and Execute for the button?
I should also mention that this code was set for the Click event for the button.
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Is JavaScript enabled in your Acrobat/Reader?

Check the preferences (ctrl + k) an ensure JavaScript is enabled.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

gaidheal
Registered: Feb 8 2010
Posts: 14
Yes, JavaScript is enabled.

I'm accustomed to working with visual basic for applications, specifically MS Access. If I write code for an action in that program, the code always is created with a function or procedure. The code samples I have see for Acrobat Javascript sometimes use that convention, sometimes not. Should this code be enclosed with a the confines of a structure such as a function? (I tried it that way and got the same non-result).

One other thing - this form started out as a Word document, coverted to pdf, then edited in LiveCycle to create the form. Would that make any difference?