By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,070 Members | 1,238 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,070 IT Pros & Developers. It's quick & easy.

Calculating elapsed time from two variables

P: 2
Hello,

I'm working on a form in Acrobat Pro 9 (not LiveCycle). I need to have an operator enter a beginning time (firsttime) & an end time (secondtime) & when s/he pushes a button (btncalcmix.0), the form calculates the total elapsed time. It must take into consideration that a test could begin at 4 pm & end at 8 am the next day. This is what I've put together so far.....but it doesn't work. I get this message: syntax error 10: at line 11.

Expand|Select|Wrap|Line Numbers
  1. // if button pushed, calculate mix time
  2.  
  3. var f=this.getField("btncalcmix.0");
  4. this.getField ("ttlmix").value = this.getField("dateform.secondtime").value - this.getField("dateform.firsttime").value;
  5.  
  6. if ((this.getField("dateform.secondtime").value)="" || (this.getField("dateform.firsttime").value="")); {
  7. this.getField("ttlmix").value = 0;
  8. }
  9.  
  10. if((this.getField("dateform.secondtime").value) <- this.getField("dateform.firsttime").value)) {
  11. ((this.getField ("ttlmix").value)*24)+24; 
  12. } else {
  13. this.getField("ttlmix").value)*24));
  14. }
  15.  
  16. if (f.value!= "true") {
  17. this.getField("ttlmix")=util.printd("HH:MM:ss", new Date());
  18. }
Any suggestions? Thank you in advance.
Mar 24 '09 #1
Share this Question
Share on Google+
1 Reply


Dormilich
Expert Mod 5K+
P: 8,639
too many closing parentheses (1 open, 4 closing)
Mar 25 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.