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

Calculate fields with 'if' - just won't work

Bocky
Registered: Jun 15 2009
Posts: 2
Answered

Hi,

I'm trying to create a mulitpage candidate report. In it I need to insert an explication for scores on a certain competency. So I made a table with 3 rows: competency, score, explanation.

The score is a drop down list (CompScore) and when the client selects a score, the text (here 1 to 5, also tried "x", "xx", ...) in the third column (ListBox1) should appear automatically. Here's what I've got in the third column syntax:

if (CompScore = 1) then
ListBox1 = 1
elseif (CompScore = 2) then
Listbox1 = 2
elseif (CompScore = 3) then
ListBox1 = 3
elseif (CompScore = 4) then
ListBox1 = 4
else
ListBox1 = 5
endif

I've already tried several variations (without , adding var in front of the names), but Apparently I am doing something very wrong here and I can't find the answer either in the scripting reference, nor in the posts on this forum, so could anyone please help?

*Note: listbox1 is on a lower hierarchic level than Compscore

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

The Learning Center here at AUC is chock full of great resources for you, so be sure to check there as well to see what's available when you have questions. This tutorial from the Learning Center shows how to work with list fields and includes an example LiveCycle form with code you can download and examine-

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

Hope this helps,

Dimitri
WindJack Solutions
www.windjack.com
www.pdfscripting.com
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
For others, LiveCycle Designer under the "Help" menu bar option includes the "Scripting Reference" that provides a lot of bais reference material about FormCalc syntax, operators, furnctions and other helpful information.

George Kaiser