Password Protect a single field

1,411 views
Skip to first unread message

Anand

unread,
Jun 30, 2010, 11:32:18 AM6/30/10
to Adobe LiveCycle Developers
I would like some help. I am not a software developer and am totally
clueless with scripting.

I created a PDF form using LiveCycle Designer 8.05. In the form I want
to password protect just a single textfield.

What I tried:

I came across a posting/suggestion by Thom Parker on the web where he
said it could be accomplished with javascript. I basically copied the
code into the script editor as follows on the textfield:

************************************************************************************************************************
----- form1.#subform[0].TextField2::click: - (JavaScript, client)
----------------------------------

var cRtn = app.response("Please Enter Password:", "Document Control
Only");

if(cRtn == "12345")
{
SCPONo.access = "open";
this.presence = "hidden";
xfa.host.setFocus("xfa.form.form1.SCPONo");
}
************************************************************************************************************************

But this kind of works and dont work. If I tab into the field it does
not ask for a password. It I click the field I get promted for a
password. I can enter the password or hit cancel and enter information
in the field. So technically the field is not password protected.

Thom does talk about covering the field with a transparent button, no
border and no fill color. When user click on the field they are
really clicking on the button. Then put the code in the button, If
they enter the correct password, then remove the button and enable the
text field.

I tried to do that and couldn't figure out exactly how to do it, or
could have been doing it incorrectly.

Any help will be greatly appreciated. I can post my form if its easier
that way.

Anand

iagos...@gmail.com

unread,
Jul 1, 2010, 3:05:05 AM7/1/10
to Adobe LiveCycle Developers
Hi Anand

If you share with me you example i could see your problem :)

Regards!

Hemant

unread,
Jul 1, 2010, 5:20:48 AM7/1/10
to Adobe LiveCycle Developers
HI Anand,

Can you give the business justification as to why you want to
implement this feature.

Since protecting only the field and not the entire document is of no
use.
It can be breached easily.

Regards,
Hemant Garg

On Jul 1, 12:05 pm, "IagoSea...@gmail.com" <iagosea...@gmail.com>
wrote:

farm1991

unread,
Jul 1, 2010, 11:00:46 AM7/1/10
to live...@googlegroups.com
Anand,

I have a form that has two signatures on it that protect two sections independently, if you think it will help I will be happy to send it to you.

Steve

--- On Wed, 6/30/10, Anand <aaaa...@gmail.com> wrote:
--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To post to this group, send email to live...@googlegroups.com.
To unsubscribe from this group, send email to livecycle+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/livecycle?hl=en.

farm1991

unread,
Jul 1, 2010, 11:15:36 AM7/1/10
to live...@googlegroups.com
Anand,
Here is how I did it.

I created a signature field
under Object select the signature tab
check the lock field after singing
in the drop down select <<new/manager Collection...>>
add a new collection must start with a letter
select modify
select the field you want to protect
close make sure on the signature tab the All fields in collection is selected.
save it and this should work

I hope this helps and might be easier that java script, Steve


--- On Wed, 6/30/10, Anand <aaaa...@gmail.com> wrote:

From: Anand <aaaa...@gmail.com>
Subject: Password Protect a single field
To: "Adobe LiveCycle Developers" <live...@googlegroups.com>
Date: Wednesday, June 30, 2010, 10:32 AM

Anand

unread,
Jul 1, 2010, 4:16:55 PM7/1/10
to Adobe LiveCycle Developers
@IagoSearaP, A copy of my form can be accessed at http://www.timpo.us/signature.pdf
. All I need to do is password protect the last textfield "Tracking
Number:" What we do is we assigned a Tracking Number and then email
the form to the different folks to sign with a Smartcard. We want to
make sure none of the signatories inadvertently or knowingly change
the Tracking Number.

@Hemant , see above why I am trying to password protect the textfield.
I do agree that if I dont password the the entire documents it be
breached. That is still an option.

@Steve, I checked out your solution, but that is applicable only for a
Signature field and not a Textfield.

My form can be accessed at http://www.timpo.us/signature.pdf . Any
suggestions to get this to work.
Anand



On Jul 1, 11:15 am, farm1991 <farm1...@bellsouth.net> wrote:
> Anand,
> Here is how I did it.
>
> I created a signature field
> under Object select the signature tab
> check the lock field after singing
> in the drop down select <<new/manager Collection...>>
> add a new collection must start with a letter
> select modify
> select the field you want to protect
> close make sure on the signature tab the All fields in collection is selected.
> save it and this should work
>
> I hope this helps and might be easier that java script, Steve
>
> --- On Wed, 6/30/10, Anand <aaaan...@gmail.com> wrote:
> To unsubscribe from this group, send email to livecycle+...@googlegroups.com.

Hemant

unread,
Jul 2, 2010, 12:04:17 AM7/2/10
to Adobe LiveCycle Developers
HI Anand,

I had created a PDF Form exactly according to your requirement.
http://groups.google.com/group/livecycle/web/Hemant_Passprotect.pdf

Regards,
Hemant

Abhijit

unread,
Jul 2, 2010, 3:44:48 AM7/2/10
to live...@googlegroups.com
Hi Anand,

A better approach to this would be to make the field read only. You
can make the tracking number filed Read Only thereby ensuring that no
one modifies it.

Regards
Abhijit Ghosh

Duane Nickull

unread,
Jul 2, 2010, 12:23:12 PM7/2/10
to Adobe LiveCycle Developers
I have to agree here.  If you just want to make the field protected from mutation, this is the best way.

In general, using JavaScript in a self enclosed environment (like a PDF document) for security is a very bad idea since anyone with LC Designer can open it and read your JS code.

Duane

Carlos Nascimbene

unread,
Jul 2, 2010, 12:45:13 PM7/2/10
to live...@googlegroups.com
I strongly agree on this!

Sometimes this concern causes that all the logic that could go potentially inside the pdf form goes to the back-end system and is exposed via a WS that the pdf form can consume. In these situations only remains the basic validations, the subforms manipulations and the connections/submit JS into the pdf form..
As far as I know there is no way to block someone from editing the pdf form with designer and see your JS code...

What' would be the best way to protect the JS inside a PDF Form? There is something that I'm missing...?

Saludos,

Carlos
image.jpg

Jono Moore

unread,
Jul 2, 2010, 1:03:01 PM7/2/10
to Adobe LiveCycle Developers
On Jul 2, 9:45 am, Carlos Nascimbene <cnascimb...@gmail.com> wrote:
> As far as I know there is no way to block someone from editing the pdf form
> with designer and see your JS code...

You can password protect the pdf from editing.

Anand

unread,
Jul 2, 2010, 4:03:34 PM7/2/10
to Adobe LiveCycle Developers
@Abhijit & @Duane, I tried that first, making the field Read Only
(Object/Value/Read Only), but than I could not enter anything the
field. This is the I fill in then distributed for Digital Signatures.
Unless I doing this all wrong and there is another way of doing it.

Anand


On Jul 2, 12:23 pm, Duane Nickull <dnick...@adobe.com> wrote:
> I have to agree here.  If you just want to make the field protected from mutation, this is the best way.
>
> In general, using JavaScript in a self enclosed environment (like a PDF document) for security is a very bad idea since anyone with LC Designer can open it and read your JS code.
>
> Duane
>
> On 7/2/10 12:44 AM, "Abhijit" <abhiji...@gmail.com> wrote:
>
> Hi Anand,
>
> A better approach to this would be to make the field read only. You
> can make the tracking number filed Read Only thereby ensuring that no
> one modifies it.
>
> Regards
> Abhijit Ghosh
>
>
>
>
>
> On Fri, Jul 2, 2010 at 9:34 AM, Hemant <garg.heman...@gmail.com> wrote:
> > HI Anand,
>
> > I had created a PDF Form exactly according to your requirement.
> >http://groups.google.com/group/livecycle/web/Hemant_Passprotect.pdf
>
> > Regards,
> > Hemant
>
> > --
> > You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
> > To post to this group, send email to live...@googlegroups.com.
> > To unsubscribe from this group, send email to livecycle+...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/livecycle?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
> To post to this group, send email to live...@googlegroups.com.
> To unsubscribe from this group, send email to livecycle+...@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/livecycle?hl=en.
>
> ---
> Adobe LiveCycle Enterprise Architecture -http://www.adobe.com/products/livecycle/
> My TV Show -http://tv.adobe.com/show/duanes-world/
> My Blog -http://technoracle.blogspot.com/
> My Band -http://22ndcenturyofficial.com/
> Twitter -http://twitter.com/duanechaos/
>
> [cid:3360907392_70990378]
>
>  image.jpg
> 16KViewDownload

Hemant

unread,
Jul 2, 2010, 4:08:54 PM7/2/10
to Adobe LiveCycle Developers

Duane Nickull

unread,
Jul 2, 2010, 4:17:44 PM7/2/10
to Adobe LiveCycle Developers
Can you re-explain the exact way the data is generated and entered?

Is it possible you can have the field read only, then trigger it to be enabled when the field value needs to be entered and then immediately change it back to read only?  I can do this for you in a few seconds if you want.

Duane
For more options, visit this group at http://groups.google.com/group/livecycle?hl=en.



---

Anand

unread,
Jul 2, 2010, 4:20:01 PM7/2/10
to Adobe LiveCycle Developers
@Hemant, Thanks your form works the way I want. I am using LC Designer
8.0. When I open your form in LC Designer 8.0 I get one of the those
warning messages requiring a newer version of Designer, though it
still opens the file. When I use the exact code you have in my file it
sort of works the way I want it, ie i get prompted of a password and I
can fill in the form. After filling in the form (Adobe Acrobat
Professional) and saving the file, when I reopen the file, i can edit
the field. So I suspect it could be because of LC 8.0 features.

I am going to download a trial version of LC 9.0 and see if it makes a
difference.

Anand

On Jul 2, 4:08 pm, Hemant <garg.heman...@gmail.com> wrote:
> Anand,
>
> Let me know if  the below PDF is what you require?:http://livecycle.googlegroups.com/web/Hemant_Passprotect.pdf?gda=Zxtk...

Karunakaran, Anand

unread,
Jul 2, 2010, 4:33:53 PM7/2/10
to live...@googlegroups.com
@Duane, Attached are 2 files. The file "Hemant_Passprotect.pdf" is the one Hemant did. The file "RO-Form.pdf" is the one I created after looking at Hemants code. On my form I after filling and saving the Tracking # field, I can reopen the file and edit it. This does not happen with Hemant's file. I am trying protect the Tracking # field, so when I fill it and send it for Digital Signature no one changes the Tracking #.

Anand
image.jpg
Hemant_Passprotect.pdf
RO-Form.pdf

Duane Nickull

unread,
Jul 2, 2010, 5:07:46 PM7/2/10
to Adobe LiveCycle Developers
Is this what you want?
> > To post to this group, send email to live...@googlegroups.com <http://live...@googlegroups.com> .
> > To unsubscribe from this group, send email to livecycle+...@googlegroups.com <http://livecycle+...@googlegroups.com> .
> > For more options, visit this group athttp://groups.google.com/group/livecycle?hl=en <http://groups.google.com/group/livecycle?hl=en> .

>
> --
> You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
> To post to this group, send email to live...@googlegroups.com <http://live...@googlegroups.com> .
> To unsubscribe from this group, send email to livecycle+...@googlegroups.com <http://livecycle+...@googlegroups.com> .
> For more options, visit this group athttp://groups.google.com/group/livecycle?hl=en <http://groups.google.com/group/livecycle?hl=en> .

>
> ---
> Adobe LiveCycle Enterprise Architecture -http://www.adobe.com/products/livecycle/
> My TV Show -http://tv.adobe.com/show/duanes-world/
> My Blog -http://technoracle.blogspot.com/
> My Band -http://22ndcenturyofficial.com/
> Twitter -http://twitter.com/duanechaos/
>
> [cid:3360907392_70990378]
>
>  image.jpg
> 16KViewDownload

--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To post to this group, send email to live...@googlegroups.com <http://live...@googlegroups.com> .
To unsubscribe from this group, send email to livecycle+...@googlegroups.com <http://livecycle+...@googlegroups.com> .

For more options, visit this group at http://groups.google.com/group/livecycle?hl=en.


ImmutableTrackingNo.pdf

Abhijit

unread,
Jul 3, 2010, 12:48:41 AM7/3/10
to live...@googlegroups.com
@Anand: You can do it the following way first fill the form and then
while distributing it make it read only that ways you would ensure
that no one else changes.

Abhijit

unread,
Jul 3, 2010, 12:52:25 AM7/3/10
to live...@googlegroups.com
Forgot to see Duane reply on that i think he has provided the solution
to you. If not kindly let us know how you distribute the form .

Regards
Abhijit Ghosh

Tarek Faham

unread,
Jul 3, 2010, 3:54:58 AM7/3/10
to Adobe LiveCycle Developers
Hi Anand,

Why not using Digital Signature to secure the field in question ?

You can use Digital Signature to unlock the filed if the signature is
signed. Also, you can make the Digital Signature secured by forcing only
certain people to be able to sign the form. I have done this last year,
and it worked successfully.

Will this help ?

Tarek.

--
http://www.fastmail.fm - Send your email first class

Reply all
Reply to author
Forward
0 new messages