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

Populating a Drop Down list - please help!

neth
Registered: Mar 17 2010
Posts: 25

Dear all,

Can anyone tell me how to easily populate a drop down list in livecycle designer? I have a list of over 100 items (see below for examples) where users completing a form will only select 1 of these items. I cannot seem to find an easy way to do this despite several attempts at trying. I thought I could copy and paste the list into the xml source (enclosed in text tags but this does not seem to work and comes up with an error message. I'm new to livecycle as well so this does not help eiether!

I'm using Livecycle designer ES 8.2 that comes with Acrobat Pro 9. Any help would be greatly appreciated.

Items-
A Medicine and Dentistry
A100 Pre-clinical Medicine
A200 Pre-clinical Dentistry
A300 Clinical Medicine
A400 Clinical Dentistry

Thanks,

Ken

My Product Information:
LiveCycle Designer, Windows
jonom
Registered: Jan 31 2008
Posts: 133
As long as you paste the list between the ... tags it should work.100 Mile House
Abbotsford
Anahim Lake
Bella BellaStart a dropdown list with one item assigned and then go into the xml source and paste into where that item is.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Before modifying the XML directly, add a few items, and export values to the list. Then open the xml and see how these values are formatted and where they are placed.

if these values will change periodically then you might consider using code to fill the list when the form is opened. A list placed in code will be easier to maintian than a hard coded list in the XML


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

neth
Registered: Mar 17 2010
Posts: 25
Thanks for getting back to me, I've managed to sort it!

Thom - I wonder if I could ask you could help with a problem I am having with linking lists and combo fields? I looked at the tutoral for this and its exactly what I want to do (http://www.acrobatusers.com/tutorials/2007/js_list_combo_livecycle) but still cannot seem to get this to work.

I have a list of items in a drop down (see below) and when you select one of these (such as Bachelor of Arts (BA)) I want a range of options in another drop-down (Mode of Study, eg. full-time) to become available to choose and once one of these is chosen I then want a defined variable to appear in a text box. The only exception to this is where variable mode of study is selected, as I would like it to be possible to have the option to make a custom entry into the text box. I'd also like to add a line if there is more than one qualification just like in your example where an order line can be added.

Any help, would be greatly appreciated!

Thanks,

Ken

Drop Down Variables 1 (Qualifcations) Examples (in total there are about 20 of these):
Certificate of Higher Education (Cert HE)
Diploma of Higher Education (Dip HE)
Foundation Degree in Arts (FdA)
Foundation Degree in Science (FdSc)
Bachelor of Arts (BA)
Bachelor of Dental Surgery (BDS)
Bachelor of Engineering (BEng) etc....

Drop Down Variables 2 (Mode of Study)
Full Time
Part Time
Full Time & Part Time
Distance Learning (Full Time)
Distance Learning (PartTime)
Distance Learning (FT & PT)
Variable Mode

Text Box Defined Variables (Duration of Programme)
Certificate of Higher Education (Cert HE) + Full Time = 1 Academic Year
Certificate of Higher Education (Cert HE) + Part Time = 2 Academic Years
Certificate of Higher Education (Cert HE) + Full Time + Part Time = 1AY FT / 2AY PT
Certificate of Higher Education (Cert HE) + Distance Learning (Full Time) = 1 Academic Year
Certificate of Higher Education (Cert HE) + Distance Learning (Part Time = 2 Academic Years etc.....
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You've outlined a pretty complex process. On the forum I can't really answer something like this, beyond pointing you to the article you've already read.

Is there some specific part of the process that is giving you trouble?

Have you seen this eseminar?
https://admin.adobe.acrobat.com/_a200985228/p87746471/

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

neth
Registered: Mar 17 2010
Posts: 25
Hi Thom,

I watched the eseminar last night - its very useful, thanks. I've had another stab at doing this based on your example Windjack form where assembly, links to parts and then to price. This is almost exatcly what I want to do, except instead of the last field being price I want it to be a text field at the end. I can get it to work for a few examples but then it stops working, which is frustrating! Would you be able to take a look at the form at all to point me in the right direction please?

Thanks again for your help,

Ken
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
If the form works, and then stops when you add a new feature you've probably got a simple error, and it's time to do some debug. This is an extremely common situation that you will encounter time and time agian in any kind of development project.

So the first question to ask is: "is anything reported in the console window?"

I don't normally do form and code analysis for free. That's more of a consulting job. On this forum I stick with answering single issues. However, I hear that Adobe is providing free LiveCycle form analysis and scripting at forums.adobe.com/community/acrobat. You might want to post your question there.

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

neth
Registered: Mar 17 2010
Posts: 25
Hi Thom,

I did as you suggested and poste by question at Adobe.com and luckily for me someone came back with a sample form! - https://acrobat.com/#d=bCr3y2NrV73QpAB7JTYXDw - Its scripted differently to the Windjacker parts one I was looking at copying but seems to work fine.

The issue I am now having is tweaking this slightly as the process for specifying data to be specified in the final textfield may be more comlex than I first thought, as the final field is always dependant on the exact qualification and exact mode selected so the end result will not always be the same. Is there a way possible to account for this some how? I've played around with editing the script but cannot seem to find a solution. Am i missing something?! For instance if you choose a qualification from the list and choose full time mode you could end up with these options (there are others also):

Certificate of Higher Education (Cert HE) + Full Time = 1 Academic Year
Bachelor of Arts (BA) + Full Time = 3 Academic Years
Bachelor of Arts (BA) [Study Abroad/Placement] + Full Time = 4 Academic Years

Is it also possible to allow custom entries in the final textfield, for instance when you select variable mode? I've tried to alter this in the 'value tab' of the object to make it 'calculated - user can overide' but this produces an error message and then deletes the custom text I enter.

Thanks again for your help and advice, really appreciate it!

Ken
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
More complex relationships between selections (or form input) and results can be created, and better maintained, by using an object to map the inputs to the results. Using a generic JavaScript object as a data map creates a level of indirection that decouples list items from the data used. This is a common programming technique that I've used on many of my forms. Including my LiveCycle list examples that you've already seen.

Overriding calculations is possible, but it's not as simple as LiveCycle Designer makes it seem. What is the error message your are seeing?
Take a look at the XML for the field, and look in the XML forms object reference at the "override" property.

I wrote an article on this topic for www.pdfscripting.com (members only content).

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

neth
Registered: Mar 17 2010
Posts: 25
Hi Thom,

I'm not sure I understand, which is probaly due to my inexperience with livecycle/scripting! Are you suggesting I should use the windjacker assembly/parts form as a template rather than the other form that someone prepared because of the different way the script funtions? Apologies in advance if this sounds like a stupid question!

Thanks again,

Ken
neth
Registered: Mar 17 2010
Posts: 25
Hi Thom,

Hold that thought! Someone kindly reply on the form and provided another sample - https://acrobat.com/#d=FXYAA3tcUvMonBSzq8Rthg - which uses a similar method like the windjacker form in the script. I think I understand better now, as depending which script is used will depend on how the form works and how the final value is derived in my last box (like the price field in your windjacker example).

Think I might be on my way now :-)

Thanks again for your help!

Ken
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Please don't make up terminology or read more into my comments than what's there. And in fact you did follow my suggestion, or who ever answered your question did ( it looks a lot like my code). The variable "oStudyOptions" is a generic JavaScript object that's used to map entries in one list to entries in another list.

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