Hello,
i want to create a textfield, where the sum of values from around 24 dropdown fields is displayed. Its important that i get the values (e.g. 1, 2) not the displayed text in the field.
I'm using Adobe lifeCycle Designer.
I know how to do it with Acrobat Pro, but i've chosen the Designer for my form.
Is there any function or a jscript?
Please help me.
Yours,
Michael
If you write your script in JavaScript (make sure you specify JavaScript as the language in the Script Editor when you're editing the Calculate event), it would look like this:
drop1.rawValue + drop2.rawValue + ... + drop24.rawValue;
Notice there's no assignment. That's because the scripting engine looks for a value set by the event.
This way, whenever the user picks a new item from any of the drop down lists, the summation field's value will automatically be recalculated.
Depending on how you've setup your form, you may also be able to use FormCalc to make the summation easier. If you've given the same name to all the drop down lists, then you'll have occurrences of a drop down list (such as droplist[0], droplist[1], ..., droplist[23]). In that case, you can use the FormCalc "Sum()" function to do the work for you. In the summation field's Calculate event, you would set the language to FormCalc and use the following script:
Sum(droplist[*])
This would set the summation field's value to the sum of all occurrences of the "droplist" field.
Stefan Cameron obtained his bachelor's degree with Honors in Computer Science at the University of Ottawa and is a Computer Scientist working on Adobe's LiveCycle server products, in particular on LiveCycle Designer ES for the past 5 years.