Quantcast
Channel: Adobe Community : Unanswered Discussions - Acrobat
Viewing all articles
Browse latest Browse all 73766

Javascript Help Needed to do calculations with boolean logic

$
0
0

I have a form here  https://workspaces.acrobat.com/?d=Cc013FJeVGtcPt*h1U*4Ww

 

Sample2.JPG

This is the tricky part of the form. So far, I've set it up so that there are three tiers of mileage options as follows:

 

1.  STANDARD  If you wanted to charge all miles driven a flat fee you would enter a number here for cost/mile. It could be for all miles or miles less than first limit.

 

2.  MILEAGE LIMIT 1  All miles driven over what ever you choose, up to but not exceeding the second limit, if there is any, at the set cost/mile.

 

3.  MILEAGE LIMIT 2  All miles driven over what ever you choose, beyond this limit, if there is any set, at the set cost/mile.

 

It would be nice to develop javascript that would allow me to do the following:

 

For miles < first limit, the cost would be the standard fee times the number of miles driven up to the first limit or 1 to < [First Limit], but only if a number is inputted into the [First Limit]

 

For miles in excess of the [First Limit] or  < [Upper Limit] >= [First Limit], the number of miles would be charged the amount set in cost per miles for the [First Limit]

 

For the miles in excess of the [Upper Limit] , or >= [Upper Limit]   - the miles cost the number of miles driven times the amount set for cost/mile

 

It would also be great to set a trap so no negative numbers or zero return an error but are reported as not allowable.

 

ANy ideas would be welcome


Viewing all articles
Browse latest Browse all 73766

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>