Simple calculations on pdf fillable form

Explorer ,
Oct 17, 2017

Copy link to clipboard

Copied

I have an excel spreadsheet which contains simple calculations but it seems not working on pdf fillable form with custom calculation script?

can anybody help me to get rid of this issue?

Actually, I am doing this calculation on a filed but don't know to achieve this figure result in field

100*(1+25%)

So, 25% field can be read-only or not visible but this will not calculate the result of 125?

Here is the code I am using:

// Get first field value

var v1 = getField("pay rate").value;

// Get second field value

var v2 = getField("Text2").value;

// Set this field value equal to the difference

event.value = v1 * v2;

I am hiding 25% filed as this will remain same and do not need to show.

Here are excel sheet and pdf form

Capture.PNG

I am attaching excel sheet and pdf file for reference.

Thank You in advance!

100*(1+25%)
Adobe Community Professional
Correct answer by Bernd Alheit | Adobe Community Professional

Divide the value by 100.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

1.2K

Likes

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

Simple calculations on pdf fillable form

Explorer ,
Oct 17, 2017

Copy link to clipboard

Copied

I have an excel spreadsheet which contains simple calculations but it seems not working on pdf fillable form with custom calculation script?

can anybody help me to get rid of this issue?

Actually, I am doing this calculation on a filed but don't know to achieve this figure result in field

100*(1+25%)

So, 25% field can be read-only or not visible but this will not calculate the result of 125?

Here is the code I am using:

// Get first field value

var v1 = getField("pay rate").value;

// Get second field value

var v2 = getField("Text2").value;

// Set this field value equal to the difference

event.value = v1 * v2;

I am hiding 25% filed as this will remain same and do not need to show.

Here are excel sheet and pdf form

Capture.PNG

I am attaching excel sheet and pdf file for reference.

Thank You in advance!

100*(1+25%)
Adobe Community Professional
Correct answer by Bernd Alheit | Adobe Community Professional

Divide the value by 100.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

1.2K

Likes

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
Oct 17, 2017 0
Adobe Community Professional ,
Oct 17, 2017

Copy link to clipboard

Copied

25% is 0.25 decimal value.

Likes

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
Reply
Loading...
Oct 17, 2017 0
Explorer ,
Oct 17, 2017

Copy link to clipboard

Copied

Yes but I want this =500*125% and 500 is input figure means the user can enter any other figure.
So when I go to Simplified field and enter field name * 0.25 result is not correct

Likes

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
Reply
Loading...
Oct 17, 2017 0
Explorer ,
Oct 17, 2017

Copy link to clipboard

Copied

Can you please check excel sheet? I want calculations on this excel sheet to pdf fillable form?

EXCEL SHEET

Likes

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
Reply
Loading...
Oct 17, 2017 0
Most Valuable Participant ,
Oct 17, 2017

Copy link to clipboard

Copied

Multiply by 1.25, then.

Likes

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
Reply
Loading...
Oct 17, 2017 0
Explorer ,
Oct 17, 2017

Copy link to clipboard

Copied

Thanks, It's working, Now there is a little problem on second fields of Margin $ which is also multiplied by two fields but one of them is % figure so if I multiply both fields:

125*50%= I got 6250 instead of 62.5?

Likes

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
Reply
Loading...
Oct 17, 2017 0
Explorer ,
Oct 17, 2017

Copy link to clipboard

Copied

also, % figure is not fixed figure this is fillable fields so the user will enter this figure and this will multiply by one another figure?

Likes

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
Reply
Loading...
Oct 17, 2017 0
Explorer ,
Oct 17, 2017

Copy link to clipboard

Copied

Can anyone here help me, please? I need this done urgently...

Likes

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
Reply
Loading...
Oct 17, 2017 0
Adobe Community Professional ,
Oct 17, 2017

Copy link to clipboard

Copied

Divide the value by 100.

Likes

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
Reply
Loading...
Oct 17, 2017 0