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

can you make lists: if one box is 'item 1' then the next is a list?

dwelch@ykfirepr...
Registered: Apr 10 2009
Posts: 20
Answered

gkaiseril gave me a couple of articles to read by Thom Parker

Programming List and Combo fields in Acrobat and LiveCycle forms - Part 1
Programming List and Combo Fields in Acrobat and LiveCycle forms- Part 2

But they do not appear to relate to Acrobat 9 so my question still stands as posted earlier:

Like validation lists in excel, can I have a list box where if I choose 'Item 1' then the next (chosen) box is a list of items associated with Item 1, and so on for item 1, item 2 etc..?

Thanks
Dave

My Product Information:
Acrobat Standard 9.3.1, Windows
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi dwelch,

The scripts and the code in those articles do work in Acrobat 9. Not that much has changed regarding JavaScript from 8 to 9 regarding form field programming.

Yes, you can do what you describe. Those articles and the sample files pretty much have all the info needed to make it happen- you just need to spend time altering the code for your specific situation.

Hope this helps,

Dimitri
WindJack Solutions
www.pdfscripting.com
www.windjack.com
dwelch@ykfirepr...
Registered: Apr 10 2009
Posts: 20
Thanks Dimitri. I sent you a PM because if feel like a dummy, but really since there are no dumb questions (mostly) I'll post it here anyways in case someone else has a different take on the matter that will help me understand. At the start of Thom's article it says: Scope: All Acrobat Full versions (not Standard) and LiveCycle Designer

Skill Level: Beginner. (eeeeep!)

Then as you carry on and it moves past Figure 1 it shows us some Java Script I presume?:
var oAssemblyParts = {
Chasis: [
["-","None"], ["Rear Bracket",205.95],
["Front Bracket",185.95], ["Long Support",44.95],
["Front Bearing",48.95]

Where did this come from, or in what was this created? When you search Help for Java Script there is nary a thing to be found! Nada! The only reference I could find in all my searching of my 9 Standard was under Edit / Preferences / Java Script where JavaScript is Enabled and the Use Acrobat JavaScript Editor Button is also enabled.

But where is said JavaScript Editor??? If it was really so important, why is it so difficult to find? Are you sure it's a part of 9 Standard and I'm just confusing everyone with my confusion? (I have 9.3.1)

Sincerely frustrated
Dave
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi Dave,

First, I apologize for not looking at your product info and seeing you were using Acrobat Standard. In the article it does state it is for Full Acrobat which means Acrobat Professional. That article was written in 2007 so Acrobat 8 was current then.

BUT having said that, when Acrobat 9 was released Adobe added the ability to create form fields in Acrobat 9 Standard too (form fields could only be added in previous versions if you had Professional). I don't have Acrobat Standard installed on any of my systems right now so I don't know just how much JavaScript functionality you can add to PDFs with it. Specifically in this case, Document Level scripts, which are used in those articles to store the list items. I do know that you can add scripts to form fields in Standard so the JS Editor should be there. In Acrobat Pro the JS editor can be activated with Ctrl-J, try that in Standard and see if it comes up.

JavaScript is a programming language Adobe chose to add to Acrobat so additional functionality could be added to PDFs. Almost all of the powerful and cool features people want in their forms require some scripting. All the scripts in those articles are "written" by Thom and he is a programmer- they do not come from anything in the Acrobat software. PDF scripting is a HUGE topic and a source of frustration for lots of Acrobat users because they just need to create intelligent forms but they are not programmers. You are not alone, believe me. Scripting is on the easier side of software programming, but it still is another skill set to learn. However, most forms have common features everyone wants like your list fields, so what many people do is they find scripts in tutorials, articles, or from user forums and they copy and paste them into their forms. This can be tricky and frustrating too. You can get lucky and find just what you need, or you can tear your hair out trying to get something to work because you really don't understand the scripting language.

My company pretty much does nothing but scripting projects for PDF and we are always busy. Because PDF forms are in high demand and most require scripting of some sort, we started a membership site that is all about this subject- www.pdfscripting.com. We have some free videos at the site that I think will help you understand what Acrobat JavaScript is- http://www.pdfscripting.com/public/34.cfm
The free videos have live links on that page.

Thom has also written some basic prep stuff on his blog here about getting started with scripting you may find helpful-
http://www.acrobatusers.com/blogs/thomp/preparing-write-javascript
http://www.acrobatusers.com/blogs/thomp/copying-and-pasting-code
http://www.acrobatusers.com/blogs/thomp/objects-distance-may-appear-smaller-they-actually-are

This is getting really long! I hope info helps a bit to give you a better understanding of PDF scripting.

Dimitri
WindJack Solutions
www.pdfscirpting.com
www.windjack.com
dwelch@ykfirepr...
Registered: Apr 10 2009
Posts: 20
Dimitri

Awesome stuff! Thanks for taking the time. Ctrl-J does nothing for me in Standard. Perhaps I will have to upgrade.

A short explanation; We have been using Excel spreadsheets for many years as the software of choice for our inspection forms. Quite frankly it does most things very well for our purposes, including graphing and the likes. Oddly though, we take the finished report and convert it to pdf before we post them in our on-line data base. We have been entertaining the use of tablet pc's with touch screen or digitizer pen U.I. for a while also and I have been looking for the best product to fit our Excel report forms. But it occurs to me that maybe our reports should be pdf based right from inception. I was just trying to see if I could make everything I need work pretty much the same way in the pdf format as it does for us in Excel.

I would be flattered if you shared your thoughts on my situation.

Regards
Dave
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi Dave,

I have since found out that Document Level scripts cannot be added in Acrobat 9 Standard, and in addition the JavaScript Debugger is not installed in Standard either.

If the forms are used by a closed group of people in your organization, I'm not sure what the value would be for using PDF over the Excel forms. PDF would be better if the forms were for the general population because you could ensure the look/layout would be the same for anyone using it and that can't be said for Excel. Charting in Acrobat can be done with Flash and scripting but is not a simple task, nor at the moment a robust feature. I guess given what you describe I would stay with Excel and convert to PDF for the final filled doc just as you are doing now.

Hope this helps,

Dimitri
WindJack Solutions
www.pdfscripting.com
www.windjack.com
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Adobe has provided a fix for installing or activiating the JavaScript console in version 8, it is part of the SDK, [url=http://blogs.adobe.com/pdfdevjunkie/2008/10/how_to_use_the_javascript_debu.php]How to Use the JavaScript Debugger with Adobe Reader[/url]. Once properly installed, you can use JavaScript console to add a document level script.

Following the referenced article and using the following folder level script, I have added a menu item for the JavaScript Console in Adobe Reader 8.0 on a remote desktop.
app.addMenuItem({cName: "JSConsole",cUser: "JavaScript Console",cParent: "Tools",nPos: 7,cEnable: (true),cExec: "console.show();"});

George Kaiser