Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Field Calculations within Drop Down Menu Items

Avatar

Former Community Member

Hello - I am fairly new to Java and I am wondering if this is possible... Trying to make an Order Form for Customers to fill out

I  have a form set up with drop down boxes to choose your product.  There  are different prices associated with the different items in the drop  down box.  Is it possible to make the script calculate in the following  way...

     if Value1 is chosen the Price is $1.25 if Value2 is  chosen the Price is $2.25 and so on?  I may have a total of 5 items in  the drop down box.

Then also I need to know if it would be easier to calculate it by using the text fields instead... for example

      Product 1 is chosen - then the customer fills in the first name and  last name text fields but not the 2nd line field the price would be  $1.25 or

     Product 2 is choosen - then the customer fills out  their first name and second line (no Last Name) and it would make the  Price $2.25 and so on...

Basically I have a form with 5  Products, 4 options per product and 1 price associated with each of  those products depending on what information is filled in and which  information is left blank.  They made this work in Excel and I wanted to  know if it will work in here also.  I am using LiveCycle ES2 and  Acrobat Pro 10

Please help me if you can - Thanks - Michelle

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Michelle,

When you select the dropdown, you can set the display items in the Object > Field palette. You have probably already one this.

In the Object > Binding palette, if you tick the "Specify values", you can type in a price for each object (1.25). This sets the bound value for each of the display items.

Where you have a price field, it can have script in the calculate event accessing the dropdown's .rawValue (which will be the bound value). For example, using JavaScript:

this.rawValue = myProduct.rawValue; 

Note that the dropdown does not format the price in the Object > Binding. It just holds the value. You can format the Price object to display in whatever currency you want.

There is an example here: https://acrobat.com/#d=RLlRdnqGtMw6RTFxWCW3rQ.

Also:

http://assure.ly/jtTkdO

http://assure.ly/fYCuQ2

http://assure.ly/iitzNJ

Hope that helps,

Niall

View solution in original post

6 Replies

Avatar

Employee

This forum is for the Adobe FormsCentral http://formscentral.adobe.comwhich  is a service that allows you to create, collect and analyze data using  an online web form. You should ask PDF related form questions in the  Acrobat forums:http://forums.adobe.com/community/acrobat/acrobat_scripting

I'll move your post to that forum so you don't need to retype it. They can help you out...

Randy

Avatar

Employee

Your right George. I missed the reference to Designer. I'll move it over there.


Avatar

Correct answer by
Level 10

Hi Michelle,

When you select the dropdown, you can set the display items in the Object > Field palette. You have probably already one this.

In the Object > Binding palette, if you tick the "Specify values", you can type in a price for each object (1.25). This sets the bound value for each of the display items.

Where you have a price field, it can have script in the calculate event accessing the dropdown's .rawValue (which will be the bound value). For example, using JavaScript:

this.rawValue = myProduct.rawValue; 

Note that the dropdown does not format the price in the Object > Binding. It just holds the value. You can format the Price object to display in whatever currency you want.

There is an example here: https://acrobat.com/#d=RLlRdnqGtMw6RTFxWCW3rQ.

Also:

http://assure.ly/jtTkdO

http://assure.ly/fYCuQ2

http://assure.ly/iitzNJ

Hope that helps,

Niall

Avatar

Level 10

Sorry, just spotted, that we discussed this here (http://forums.adobe.com/message/3655358#3655358) already!

Niall

Avatar

Former Community Member

Thank you - this is not the question I had though - you did already answer this one for me - I was hoping to find out how to link the PDF XML information to QuickBooks to create the invoice - Not sure how this one got reposted - this was already covered by you in wonderful detail - so Thank you again for your help.