Formula Update in a Form

Hi - I'm attaching a pdf. My problem is that the Total Amount Requested field is not updating when it should.  I want it to update as soon as an amount is entered in Total Miles.  But the total isn't updating until the user selects the Mileage Rate on the next line entry (which they would never know to do).  How can I get the total amount to update as soon as something is entered in Total Miles?  I don't know much about scripts - but I'm thinking this may need one?  THANKS!!
MedMileage-2010-Roch-type.pdf
EmilieKellyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mohan_sekarCommented:
I think that's the best you got. It's not possible to capture keyboard events in Acrobat, if I'm not wrong. When the user Tabs out of the Miles field, Total Amount is getting computed. You may want to check Adobe's forums, though.
0
EmilieKellyAuthor Commented:
Thank you for your reply!  Now I'm thinking of adding a button that says "Click Here to Update the 'Total Amount Requested'".  I think I need to have a Java Script to force the sum of the 8 reimb'x' fields.  I'm sorry to say that I'm not experienced in writing these scripts.  I just need a simple sum - would you be able to help me?  I'm attaching a new form that shows my attempt to do this....Thanks for you help.
MedMileage-2010-Roch-type.pdf
0
mohan_sekarCommented:
It's already doing what you're asking for - as you tab out of each field, the "Total Amount Requested" field is automatically getting updated because of the way it's set up. Am I missing something?

If you want to replicate that functionality on click of the button, copy and paste the following code in the MouseUp event of the button

this.getField("Total Amount Requested").value = parseFloat(this.getField("Reimb1").value + parseFloat(this.getField("Reimb2").value + parseFloat(this.getField("Reimb3").value + parseFloat(this.getField("Reimb4").value + parseFloat(this.getField("Reimb5").value + parseFloat(this.getField("Reimb6").value + parseFloat(this.getField("Reimb7").value + parseFloat(this.getField("Reimb8").value
0
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

EmilieKellyAuthor Commented:
It's not updating the total amount - until the user accesses the drop down box in the next line on the form.  Please look at the attachment in my last post - the Total Amount Requested is $7.40 and should be $79.64.  The Total Amount Requested won't update to $79.64 until I click on the drop down box in the 4th line.

I think the button idea will work - thank you for the code.  When I paste it into the Actions properties, I have "Select Trigger" = Mouse Up;  "Select Action" = Run a JavaScript, I get an error.  I did a screen shot of the error and am attaching it now.  Not sure what I'm missing. Thanks again.
java-error.docx
0
mohan_sekarCommented:
My bad, there is a syntax error in my code. Here is the corrected version

this.getField("Total Amount Requested").value = parseFloat(this.getField("Reimb1").value) + parseFloat(this.getField("Reimb2").value) + parseFloat(this.getField("Reimb3").value) + parseFloat(this.getField("Reimb4").value) + parseFloat(this.getField("Reimb5").value) + parseFloat(this.getField("Reimb6").value) + parseFloat(this.getField("Reimb7").value) + parseFloat(this.getField("Reimb8").value)
0
EmilieKellyAuthor Commented:
I feel really bad at my problem solving skills on this...but I'm still getting an error.  I'm attaching the newest version w. the button w. the code you just sent.  please click on the button and view the error - notice the total is still way too low.  Again - your help is so appreciated.  Thanks
MedMileage-2010-Roch-type.pdf
0
EmilieKellyAuthor Commented:
Hello - I was wondering if there was any developments on this problem?  Thanks.
0
mohan_sekarCommented:
Oops!! I missed to follow up on this one. Check the attachment
MedMileage-2010-Roch-type.pdf
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Acrobat

From novice to tech pro — start learning today.