• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

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
0
EmilieKelly
Asked:
EmilieKelly
  • 4
  • 4
1 Solution
 
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
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now