Highlighted

Acrobat form calculation - javascript help required

Community Beginner ,
Oct 09, 2020

Copy link to clipboard

Copied

This form currently calculates contract value as price per m2 x floor area

but it needs to be:-

Price per m2 x floor area x minimum hire period

(The minimum hire period being 52)

 

Eg. Boarding accommodation of 5000 m2 should come out at £1,950,000 – £2,080,000

 

I have uploaded the file with notes showing current javascript code.

https://documentcloud.adobe.com/link/review?uri=urn:aaid:scds:US:8bb7fcab-2b3d-4a05-a8ca-309d5b234ba...

 

Any help much appreciated. I'm a Javascript novice so please be gentle 🙂

Hi, see if this is what you looking for:

https://drive.google.com/uc?export=download&id=1cGudHlsipTtnWlN5sETXoNjPs55QbNkB 

I also input space in "Contract value" field between currency simbol so all fields with currency now look same.

TOPICS
PDF forms

Views

71

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

Acrobat form calculation - javascript help required

Community Beginner ,
Oct 09, 2020

Copy link to clipboard

Copied

This form currently calculates contract value as price per m2 x floor area

but it needs to be:-

Price per m2 x floor area x minimum hire period

(The minimum hire period being 52)

 

Eg. Boarding accommodation of 5000 m2 should come out at £1,950,000 – £2,080,000

 

I have uploaded the file with notes showing current javascript code.

https://documentcloud.adobe.com/link/review?uri=urn:aaid:scds:US:8bb7fcab-2b3d-4a05-a8ca-309d5b234ba...

 

Any help much appreciated. I'm a Javascript novice so please be gentle 🙂

Hi, see if this is what you looking for:

https://drive.google.com/uc?export=download&id=1cGudHlsipTtnWlN5sETXoNjPs55QbNkB 

I also input space in "Contract value" field between currency simbol so all fields with currency now look same.

TOPICS
PDF forms

Views

72

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 09, 2020 0
Engaged ,
Oct 09, 2020

Copy link to clipboard

Copied

Try to replace code in "requirements 15" field with the code below and see if that helps you:


var req1 = Number(this.getField("requirements 14").valueAsString);
var req2 = Number(this.getField("requirements 25").valueAsString);
var area = Number(this.getField("Floor Area").valueAsString);
var c1 = area*req1*52;
var c2 = area*req2*52;
event.value = util.printf("£%,0.0f",c1) + " - " + util.printf("£%,0.0f",c2);

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 09, 2020 1
Community Beginner ,
Oct 09, 2020

Copy link to clipboard

Copied

Hey. Nesa

Just tried that and it works perfectly. What a legend!

Thank you so much!!!

🙂

 

 

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 09, 2020 0
Community Beginner ,
Oct 21, 2020

Copy link to clipboard

Copied

Hi Nesa. Just when I thought this job was complete I have been asked to add two more fields 😞

Is it possible to expand the Javascript so that the floor area populates the delivery and installation and foundations fields? Both are based on floor area:-

 

Delivery calculation should be Floor area x 65 in £'s 

Foundation calalculation should be Floor area x 70 in £'s

 

PDF here

https://documentcloud.adobe.com/link/review?uri=urn:aaid:scds:US:ca64f14d-6422-451f-9038-cd43a6ae060...

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 21, 2020 0
Engaged ,
Oct 21, 2020

Copy link to clipboard

Copied

Hi, see if this is what you looking for:

https://drive.google.com/uc?export=download&id=1cGudHlsipTtnWlN5sETXoNjPs55QbNkB 

I also input space in "Contract value" field between currency simbol so all fields with currency now look same.

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 21, 2020 1
Community Beginner ,
Oct 21, 2020

Copy link to clipboard

Copied

Oh that's amazing. I can't thank you enough for your help on this. 

 

 

 

 

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 21, 2020 0