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

Populating dropdown list from a calculated text box

2ndshift
Registered: Mar 25 2010
Posts: 15

I have a form that in Field1, the user enters their Last Name and in Field2, they enter their First Name. A hidden field calculates the first initial and another calculates the last initial. Another hidden field adds calculates those fields and adds them together. So I am left with just their initials. I have succeeded up until this point.
I now would like to have a dropdown list auto populate a known word (let's say "N/A") and also the user entry of the calculated Initials field. Maybe I am making this harder than it looks, can someone tell me how to do this?
 
Thanks,
James

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes, you are making it harder than it needs to be, but that's just part of the learning process. I doubt that any of the hidden fields are necessary. They calculations could probably be combined into a single script.

See this article on list programming:
http://acrobatusers.com/tutorials/2007/js_list_combo_livecycle/

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

2ndshift
Registered: Mar 25 2010
Posts: 15
That example shows a set of known words that can populate the drop down list. What if there is a mix of user entered words in the "Initials" text Field that will be different by each user) and a default word (N/A)?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The list that is used to populate the list items can be built programmatically. The example demonstrates how an array of items can be used to populate a list. It uses a hard coded list, but where that array comes from in your code is up to you.

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

2ndshift
Registered: Mar 25 2010
Posts: 15
Thanks Thom, I'll give it a whirl.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The second example shows how to build a list of items programmatically

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

jc_peru
Registered: Apr 13 2011
Posts: 2
Finally I populated a Dropdownlist. Now how can I show my data (this is comming from DBACCESS)after I choose it from Dropdownlist? I am new in this Live Cycle..Probably It is somthing simple that nobody wants to reply.

I would like to ask you for help with dropdown list. I use LiveCycle Designer 8.2 and datadase Ms Access.

DataConnection from dropdown list to the database is Ok,
Now, I do not know how to show the rest of my data after I click enter in the populated Dropdownlist

Would it be possible to help me with this? or where can I find samples of something similar?

Thank yo for you help and attention. I look forward to your reply.


thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There is not a lot of info out there on scripting a DB connection in LiveCycle. You'll find some info on Stefan Cameron's blog. He used to write extensively about LiveCycle forms.

You'll find a full course of video tutorials and samples (for members only) that cover every detail on scripting for the LiveCycle Data Connection here:
http://www.pdfscripting.com/public/34.cfm#XFADBForms


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