Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Form Calculations

Avatar

Level 2

Hello,

I'm finally wrapping up this form when i came to the conclusion that i cant figure out how to do these javascript calculations . If a knowledgeable person could please help me with this, it would be much appreciated.

I need the miles field to default to 0.00 mi, tolls, parking, other, total for this trip and amount to be received by employee fields to default to $0.00

The total for this trip field should calculate = amount entered by user in miles multiplied by 0.555  + amount in tolls+ amount in parking+amount in other

0.555 is the $/mile amount

amount received by employee= total for this trip fields added (the user may add as many of these sections as they need so there can be multiple total for this trip fields.

This is the form:https://acrobat.com/?i=n*E*io*Bm2-UPFLKz-L-Zg

I used LiveCycle ES 8.2

THANK YOU THANK YOU THANK YOU!!!!!!

i dont know what i'd do with out adobe forums...

1 Accepted Solution

Avatar

Correct answer by
Level 10

Try this for size: https://acrobat.com/#d=NaiEoId*Icl4XM5p0-ipWw. Look at the hierarchy for a mixture of positioned and flowed subforms.

Also the calc in the Total.

Niall

View solution in original post

6 Replies

Avatar

Level 10

Hi,

Here is your form: https://acrobat.com/#d=NaiEoId*Icl4XM5p0-ipWw.

I am also make a few recommendations on layout, spacing and font alignment. I have made the two subforms positioned, as they do not contain expanding objects. The form still flows.

Hope that helps,

Niall

Avatar

Level 2

Thank you so much for your help. I just have two more concerns: the amount received by employee is not adding the totals for each trip; nothing is showing up in there. And, the purpose field is set to expand to fit as much text as needed, but now it's flowing over the line below which contains miles, tolls, etc.

You're the best!

Avatar

Correct answer by
Level 10

Try this for size: https://acrobat.com/#d=NaiEoId*Icl4XM5p0-ipWw. Look at the hierarchy for a mixture of positioned and flowed subforms.

Also the calc in the Total.

Niall

Avatar

Level 2

Helo,

I am still struggling with this delete section button. Can you please help me. It's only deleting the line it's on now "section2", instead of the entire "details" section. There's also three fields that are telling me they have misspelled words in them. When it says that, where should i look for the spelling error: in the script code ?

https://acrobat.com/?i=**MGmSD0nET47Yp6aCEQrg

Thank you again,

Ioana

Avatar

Level 10

Hi,

Here is the form back to you: https://acrobat.com/#d=Nm2jjpCvBeW9w-T4mXtuWA.

The issue is that the details part was split into different sections and the references in the script had to be changed to reflect this.

Also the spell checker does not check script, only text in form objects:

Parallels Desktop.png

Hope that helps,

Niall

Avatar

Level 2

Hi Niall,

I took a stab at placing the submission script below in the submit button of my form and when it's done and saved and re-opened as a PDF, if you click submit, it does pop up with the javascript window asking you if you want to use your default mail client (in our case outlook) but if i hit ok in that window nothing else happens. The goal is that the person clicks submit and an outlook new message pops up with the filled form attached and the to field pre-populates with my email: ioana.hartz@umassmed.edu

I really like the idea they suggest here, to have the option of saving a "flattened" copy of the filled in form to your computer.

Your help is unimaginably appreciated.

Ioana