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

Locking a Form after users enter their data

MarlaZ
Registered: Apr 28 2010
Posts: 112

Created a form (using LiveCycle Designer) for lab workers to record their results (using Reader).
I've extended permissions for saving, etc., using Acrobat.)

Once they make their record, they should not be making any changes to it. I want to somehow
have the field lock itself once their data is input. I have Add row buttons which I would want to
have the same function of being locked.

It's not the complete form doc I want locked, as after the workers complete their data input
(which is what I want locked) the administrators need to verify and fill in other fields which I
also want to lock.

I've been researching this and have found things like a signature field to lock it but I don't think
that is secure enough.

I am open to trying anything; Know however that I am not a programmer but have been using javascript in LCD.

Thank you!

Marla

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You can lock down fields by making them Read Only. In XFA forms use the "access" property of the field object.

MyField.access= "readOnly";

and

MyField.access= "open";



You'll need to pick some unique action to drive your scripts for enabling and disabling the form. You could have buttons for this that show/hide based on whether the user in in Reader/Professional. But you need to have some way of determining the status of the person using the form and controling the workflow.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

MarlaZ
Registered: Apr 28 2010
Posts: 112
Hi Thom,

Thanks

I had continued researching and found that in LCD I could set up a signature field to lock all fields or sections of the form. I tried it and it worked. The plus is that the administrators can Right-Click the Signature field and make it editable again.

Of course we have to set up a whole bunch of other stuff for them to be able to sign, and they have to be honest, and all of that. So you are right, there are issues with controlling the workflow and the form.

My mgr wants me to enable users to lock the whole document in Reader.

We also want to be able to monitor "versions" of the document but the only way I can figure that is to have users "save as" a pre-determined naming convention.

You see what I'm doing - we're taking hard copy forms that are signed, dated, corrected with a single line through the error, and so on and trying to make it doable with a saveable .pdf form.

I don't know how to allow users to put a line through an error indicating error status. I don't believe that can be done with LCD, Acrobat, and Reader.... can it?

Marla

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You are correct, users can't markup a dynamic LC form. You'll need to figure out a way to use the existing capabilities to implement the workflow.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

MarlaZ
Registered: Apr 28 2010
Posts: 112
thomp wrote:
You are correct, users can't markup a dynamic LC form. You'll need to figure out a way to use the existing capabilities to implement the workflow.Thom Parker
OK, I wasn't asking if a Reader user can mark up a Livecycle form. I know that is impossible.

Here is what I am asking:

Background - Dynamic form made with LiveCycle Designer ES 8.2.
This form is opened in Acrobat Pro 9 and Extended Permissions is turn on for the doc.
Users open this form with Reader and fill it out. They can print it. They save it.

So far, so good.

Here's where it gets fun. According to company policy, and they were using Hard Copy forms before so this is where it comes from, any mistake on the form MUSt be struck through with ONE line. It cannot be erased, whited out, or anything else. The evidence of its being written MUST exist.

SO - using LCD to make the form, is there any way that I can make this happen in Reader?

Thank you.

Marla

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I take it that the original Idea is that the filled form with errors is archived somewhere and a new correct form is created? So you have now have two forms?

This is a very paper process. Not something you'd think of doing with electronic forms.

The absolutely correct way to deal with an audit trail is to store the data on a server, or even on the form itself. But I've got an idea of how you could do this exactly like the paper process.

1. After the form is filled out lock down all the fields to make them read only.
2. If there is an error you can modify the text in field using Rich Text to add a strike through. Or you could modify the fill color to Red, which is easier.

To do this you'd need an automation script that can display all the field in the form an markup any that are incorrect.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

MarlaZ
Registered: Apr 28 2010
Posts: 112
Hi Thom,

Bear with me - I am going to explain the why so you have a better understanding. At the end there is a question or two.


The idea is to get away from the Paper forms and start using the power of the dynamic form, built in LCD ES 8.2.

I build the dynamic form. Instead of a sheet of paper with 10 rows, I have one row with an Add Row and a Rem Row button so the user can add as many rows as he needs.
I 'extend permissions' in Acrobat.

I upload this form.pdf to a server. The user downloads it and goes through every section and has to enter something into every field, or if no information, he enters N/A. I have Tool Tips set up to help instruct the user in this way.

Now, in the paper world, the user would download and print the form and fill it in. Anything he writes on the paper form must be saved as part of the 'record.' Errors are struck-through with one line.

In the Adobe Reader world the user downloads the .pdf file in Reader and fills it out electronically. The powers that be want to be able to know where errors are (that's what the strike-thru lines are for).

People will be reviewing this document once the user is done filling it out.

Once everyone is done with that, the document must be 'locked' and signed by the group in charge. I have placed a Signature Field at the end. It will lock everything up to the in-charge group's other signature text fields.

I suppose I should include a second Signature Field that they can use to lock their own e-signatures.

SO - back to "an automation script that can display all the field in the form an markup any that are incorrect." that sounds great but HOW do I do that?? Do I have to wade through hours of videos?? Is there some actual help on this that you can give me or point me to??

The other point is that I won't be doing any of the modifying once this form is being used. I am a contracter who was given the task of creating dynamic forms and have never used LCD before this project, about a month ago. SO whatever I do to make it work, I have to teach others so they can do it when I am gone.

I have to finish this by end of day, June 24th - tomorrow... Thanks for your further input.

Marla

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I don't know the specifics of changing a piece of text to add the strike-thu style. It's one of the LiveCycle rich text parameters so I know it's in there. So maybe the simplest and easiet marker is changing the text feild background to red, or something like that.

The automation script is fairly straight forward for someone familiar with Acrobat and livecycle scripting. The script needs to examine the form to find all relavant fields and build a popup menu. Selecting an item from the menu then returns the SOM path to the field so that it can be located and changed.

However the script is not simple or short. Are you a programmer?

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

MarlaZ
Registered: Apr 28 2010
Posts: 112
Hi - No I am not a programmer. I know some HTML from way back. And I've had to learn a bit of this Javascript while learning LCD. I only started the project in May. Each time I accomplished a piece, I was asked to add something else. And so it went.

So for the automation script, I wouldn't even know where to place it - LCD script editor? Source Code? Acrobat Console? I have no clue at this time.

I've learned a lot by looking at created pdfs that have the feature or function I need, viewing the pdf in Livecycle designer and then trying it in my document.

If you have or know of a pdf that has the strike-through function in it, I can play with that.

Even the script reference, I've looked at it but don't get a lot of it.

Any ideas are greatly appreciated.

Marla

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Feature creep is a killer, and quite common.

I've written an article specifically on folder level scripts and there are also several articles here that use folder level automation scripts. Take a look at this one:
http://www.acrobatusers.com/tutorials/2007/10/apply_security_with_js

And here's an article on creating popup menus:
http://www.acrobatusers.com/tutorials/popup-menus-acrobat

You should also do a search on "Automation" in the tutorials.

But as I said before this is not a trivial task. To create such an automation script you will need the help of a programmer.

There is another way that is simpler but a bit awkward, both to use and implement. Place buttons next to each field that could be marked as incorrect. Then place code in the button that adds a strike-thru to the text in the associated field.


Adding the strike-thru turns out to be much easier than I thought. This line of JavaScript will put one on the text in a field named "MyText":

MyText.font.lineThrough = "1";

The button should be hidden, then the reviewer can push a button that runs some code to show them. Like this:
var bttns = this.resolveNodes("$.*..*.ShowStrikeButt");for(var i=0;i<bttns.length;i++)bttns.item(i).presence = "visible";

The code assumes that all the buttons have the same name, "ShowStrikeButt". Be warned, I havn't tested this. I just wrote it here.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

MarlaZ
Registered: Apr 28 2010
Posts: 112
Thank you! I will try this with my form first thing in the morning! I appreciate your taking the time to help. I will let you know how it works, or if it doesn't.

Marla