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

calculation from drop down selection

kenyonpeggy
Registered: Feb 16 2009
Posts: 13
Answered

I am using Acrobat Pro 9 and working in Livecycle. I created a form that asks the user to select a media type from a drop down. I want the selection to calculate the value in a numeric field that can later be summed. The formula is listed below. I get an error message "syntax error near token " on line 1 column 11. I am not a programmer just trying to help facilitate a process.

if(MEDIA1==”WBT”)then
(L1=VL1*.25)
elseif(MEDIA1==”CBT”)then
(L1=VL1*.75)
elseif(MEDIA1==”VTC”)then
(L1=VL1*.50)
elseif(MEDIA1==”f2f”)then
(L1=VL1*1.0)
ROUND(L1)
endif

Appreciate any help

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
Some white space to make the code more readable would help.

Is 'L1' a field?
In what field is this calculation script located?

If it is the field 'L1' your code could be:
----- form1.#subform[0].DecimalField1::calculate: - (FormCalc, client) ----------------------------- if(MEDIA1 == "WBT") thenVL1*.25elseif (MEDIA1=="CBT")thenVL1*.75elseif (MEDIA1 == "VTC")thenVL1 * .50elseif (MEDIA1 == "f2f")thenVL1 * 1.0ROUND(VL1)endif

George Kaiser

kenyonpeggy
Registered: Feb 16 2009
Posts: 13
Thanks for the quick response. Yes L1 is a numeric field. My plan is to sum the results of L1 to use in another calculation.

Your code worked but I am not sure why!