Results 1 to 3 of 3

Thread: Calc Elapsed Time between 2 form fields

  1. #1
    Join Date
    Nov 2007
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Calc Elapsed Time between 2 form fields

    i have a form with 3 fields. field1 is the start time of a logged event, field2 is the end time of the event, field 3 is the elapsed time between the two field values.

    when I double click on the elapsed time field i'd like to calculate the elapsed time in hours.

    i have a double-click event that will call the function i'm looking for. I want the function to push the value into the elapsed time field.

    so in pseudo code:

    on double-click:

    take time value (military time) in END form field and subtract time value from field START and set document.form.["myform"].elapsed= results

    i'm having problems doing this the way i think it should be - firefox gives me error msgs about getHours() not being a valid function

    any help appreciated, minimal lines of code please

    thanks
    kevin

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Post a URL to the problematic site or post the code

    its much easier if we just need to modify a script then for us to re-create something that you have already done.
    if you are going to post code please encapsulate it within [code] tags

  3. #3
    Join Date
    Nov 2007
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by boogyman View Post
    Post a URL to the problematic site or post the code

    its much easier if we just need to modify a script then for us to re-create something that you have already done.
    if you are going to post code please encapsulate it within [code] tags
    sorry, no code or site ....

    i'm going to approach it using vbscript for now so that it happens during the POST operation but, i'd really like it if i could make it happen live.

    the vbscript in the form will basically do this on POST:

    elapsed.value=datediff("h", EndTime, StartTime)

    that's what i'm trying to have happen on a double click in the field

    thanks,
    Kevin

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •