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

Form calculation script

Community Beginner ,
May 21, 2018 May 21, 2018

Copy link to clipboard

Copied

I am working on a pdf form of a service report for my team.  All is going well and I am now looking at using some java script to assist me with its operation.

On the form are areas for labour, travel and parts costs. 

Here’s where it gets a little more complicated:

Currently the form auto calculates the values of labour and travel depending on the number of hours selected from a dropdown box multiplied with a predetermined rate (labour or travel). This is fine for a customer who has no service contract.

We have three variables: A customer has no contract in which case the above works perfectly.

A customer may have a ‘full contract’ in which case they do not pay for any parts, labour or travel. So I need the total boxes to read 0 or ideally “Contract”.

A customer may have a ‘support contract’ in which case they do not pay for any labour or travel. So I need the labour and travel total to read “Contract” but any parts prices to still be applicable.

I am new to the java script world and have seen that there are lots of very clever people out there. After researching the web and many forums I am just looking for advice on the best way to go about this?

The contract type is automatically populated from a merge from our CRM. The options being (None, Full or Support)

Thank you for any advice you can offer - Daniel

TOPICS
Acrobat SDK and JavaScript

Views

301

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
LEGEND ,
May 21, 2018 May 21, 2018

Copy link to clipboard

Copied

The best way is either to pay someone to make your JavaScript or to study and write your own (more rewarding, but not necessarily more cost effective). Some people expect to be able to pick up all their JavaScript by copy and paste or asking for people to write it for free, but this is rarely realistic.

This is a good project to start learning on, nothing too awkward or complex, but it should lead you to an understanding of the processes.

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
Community Beginner ,
May 21, 2018 May 21, 2018

Copy link to clipboard

Copied

LATEST

Thank you for your reply,

I am keen to learn and have already integrated a small script to spawn an additional page to attach photographs which is working well.

I have pages of example script in front of me but am really looking at identifying the correct logical sequence to follow using the if and else functions.  I have a fairly logical mind but am just struggling with the layout of the scripting at the moment.

Thanks again.

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