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

Validate Fields with the Object Print Button

30011754
Registered: Jan 6 2010
Posts: 13
Answered

Im using Adobe Lifecycle Designer ES and I have identified all my required fields on the field section. I would like to put a javascript on the object "Print Button" that when the user clicks on it, it validates the required fields and prompts the user what fields are required. Any help would be greatly appriciated.

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

please read this article.
I describes a method to validate the form before printing.
http://forms.stefcameron.com/2008/04/13/prevent-printing-pdf-forms-in-acrobat-8/

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

30011754
Registered: Jan 6 2010
Posts: 13
radzmar, Excellent! article, after reading it I was able to tweak my XML Source and it worked like a charm. Thanks for your expertise!
30011754
Registered: Jan 6 2010
Posts: 13
radzmar, My form has four required fields and after applying the XML code and testing it, it highlights all the required fields even the one that was filled. Is there a way to have the code just highlight only the fields that have not been filled?
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

you can turn off/on the mandatory property with this script in the exit:Event of your fields.

this.mandatory = this.rawValue === null? "error":"disabled";

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

30011754
Registered: Jan 6 2010
Posts: 13
Thanks ! It worked perfectly. You saved my day !