Adobe Acrobat Javascript For Loop

The JavaScript for/of statement loops through the values of an iterable objects for/of lets you loop over data structures that are iterable such as Arrays, Strings, Maps, NodeLists, and more. The for/of loop has the following syntax: for (variable of iterable). I'm creating an ordering form for a photograph printing business with Adobe Acrobat 10. The concept is that the user will input data for each photograph individually - file name, paper size and paper type into cells in a table and a fourth column will calculate the price. Sep 09, 2011  Hi all, I'm a beginner to LiveCycle and I cant seem to get a loop working within a function. The function is being called successfully because when I.

Active6 years, 7 months ago

I'm creating an ordering form for a photograph printing business with Adobe Acrobat 10. The concept is that the user will input data for each photograph individually - file name, paper size and paper type into cells in a table and a fourth column will calculate the price.

The paper size and paper type are drop down menus, Paper Size with 4 Options and Paper Type having 3 Options, so 12 combinations all with different prices.

I want a cell in the fourth column of each row to calculate the price based on the options the user has selected, but cannot reach this using addition/multiplication etc.

I have the concept that i need to write an IF statement with multiple conditions as in Excel but am not familiar with JavaScript and so need some help!

Thank you in advance!

Tom Stayte
Tom StayteTom Stayte

2 Answers

I'm not familiar with the excel format myself, but in javascript you might have something like this :

Of course there are many ways of dealing with this problem, from nesting the if statements to storing everything in a map/hash/object to using switch statements. Comparison naturally doesn't need to be against numbers, you could also use strings.

David McMullinDavid McMullin
3,3232 gold badges14 silver badges18 bronze badges

Make it an object and use it as a lookup-table to prevent too many if-else-statements:

If the user could enter invalid input, you can check for existance of the key with if (size in priceByPapersizeAndPapertype) and put an error message if needed.

Community
BergiBergi

Adobe Acrobat Javascript For Loop Windows 10

408k69 gold badges646 silver badges972 bronze badges
Javascript

Javascript In Adobe Acrobat

Not the answer you're looking for? Browse other questions tagged javascriptdrop-down-menuif-statementacrobat or ask your own question.