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

Populate Field Based on Drop Down Selection

GamecockKen
Registered: Nov 22 2011
Posts: 5

I'm extremely new to Adobe Acrobat and LiveCycle Designer and need your help. I'm trying to automatically fill in a field based on what is selected in a separate drop down box. For example, I have two fields, "Level of Performance" & "Point Value". In "Level of Performance", supervisors have the option to select Exceptional, Successful, or Unsuccessful in a drop down menu. If they were to select Exceptional, I need a "3" to show up in "Point Value", Successful would be 2 and Unsuccessful would be 1.
 
Is this possible to do, and if so....how? Thank you

My Product Information:
LiveCycle Designer, Windows
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi GamecockKen,

This tutorial from the Learning Center here discusses this and also includes download sample files with the scripts used to make it work-

http://acrobatusers.com/tutorials/2007/js_list_combo_livecycle/

Hope this helps,

Dimitri
www.pdfscripting.com
www.windjack.com
katmetz
Registered: Nov 29 2011
Posts: 7
I am also extremely new to this whole form thing. I am trying to do a similar thing, but I have no idea what i am doing. Mine is even more simple than this, but yet I can still not figure it out. I tried using a formula that I found on another post, but I can't get it to pull from my drop downs.

I am creating a timecard. It has 7 "Types" to choose from Regular, Holiday, PTO, etc.. for each day of the pay period (2 weeks).(this is not created as a chart) I am trying to come up with a summary of how many hours were worked in each Type based on the information selected in the drop downs by the form filler.

I applied the following formula to the totals text box(nCount1). This is just the formula used to calculate the Regular hours selected in the drop downs by the form filler. I would use a similar formula for each type. I am using Formcalc.

var nCount1=0

for i=0 upto Type.all.length -1 do
if (Type[i].rawValue eq "Regular") then
nCount1 = nCount1 + 8
endif
endfor

The formula has no errors, but it is not pulling from my drop downs. The total is remaining at 0

I hope this made sense..
Thanks for any help.

K. Harrison

pforms
Registered: Nov 17 2009
Posts: 87
For the OP you could have your droplist and a text field. For the droplist, use javascript on the "change" event.
Your script would look like:

if (xfa.event.newText=="Exceptional")
{yourtextfieldname.rawValue="3"}

if (xfa.event.newText=="Successful")
{yourtextfieldname.rawValue="2"}

if (xfa.event.newText=="Unsuccessful")
{yourtextfieldname.rawValue="1"}