/    Sign up×
Community /Pin to ProfileBookmark

Javascript calculation in Adobe Acrobat Pro

Hi,

I have to create a form in Adobe Acrobat Pro.

This form will have multiple rows, one per product.

I have fields: Qty, UnitPrice, TotalPrice,…

I want From to automatically show formulas result when quantity field has a valu higher to 0.

When I use Value is the Product (x) ex.:Qty,UnitPrice it works… but it shows a value of 0 when Qty field is blank, and I want it to show no value.

So I tried using Custom Calculation Script with Formula on row #1:
if (QtyRow1 * UnitPriceRow1) {QtyRow1*UnitPriceRow1;} Else {“”;}

But no value is displayed even with value is Qty Field.

Can anyone help me?

thank you

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@nap0leonJan 30.2015 — I don't use Acrobat Pro to make forms, but you posted this in the JavaScript forum so perhaps this helps:

Characters such as 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 are merely "strings" until you tell your code they are numbers.
parseInt(qty)*parseInt(price)
Copy linkTweet thisAlerts:
@redcanadienauthorJan 30.2015 — Hi nap0leon,

Thank you for your reply.

I have tried, but it makes no difference.
Copy linkTweet thisAlerts:
@rootFeb 01.2015 — All form fields have names, you have to give that field a value.

Acrobat will be no different.
×

Success!

Help @redcanadien spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...