• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Custom calculation script dependant on dropdown selection

New Here ,
Jan 30, 2020 Jan 30, 2020

Copy link to clipboard

Copied

Hi there,

 

I am creating a pricing form for a client. I have a dropdown menu of services to choose from. We then have working calculation fields where they add in their [quantity] x [price] and then it spits out the total in another text box. All is working great.

 

They've asked if I can add in a custom calculation if they select [Digital] from the services list, which then divides the [quantity] by 1000 and then multiplied by the price to calculate their total. Current calculations can stay the same if they choose any other service. 

 

Based on one dropdown item: [Quantity] / 1000 x [Price] = [Total]

 

I'm sure this is doable, but i'm pretty new to scripting in the forms and can't find anything online to know what parts to start with.

 

Any help is much appriciated.

TOPICS
Acrobat SDK and JavaScript

Views

264

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 30, 2020 Jan 30, 2020

Copy link to clipboard

Copied

LATEST

Here's an article on Conditional execution. 

https://www.acrobatusers.com/tutorials/conditional-execution/

There is an example file. 

It uses a checkboxes and radio buttons as the condition, but it's pretty much the same for dropdowns. 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines