I run a landscape crew and instead of filling out our forms manually I would like to do it via cellphone and have the times auto-calculated in the form fields. I'm *not* familiar with JavaScript and need some assistance in getting the correct code in order to calculate the crew times and total site man-hours *without* this error when I change the times. *Note:* I will use 24-hour time.

![Example of Input Error](https://i202.photobucket.com/albums/aa60/dmknappy/LMR%20SS%20Example.jpg)

I tried a few different JavaScript snippets I discovered and though they work I am getting a format error when manipulating the time input. Any suggestions on how to script this into Adobe?

**To generate the employee times I use the code below:**

**UPDATE EDIT THIS IS GENERATING INCORRECT TIMES:**
![Time Calculation Error](https://i202.photobucket.com/albums/aa60/dmknappy/CalcError.jpg)

```
// start
var start = this.getField("Monday Site #1 Start Time").value;
var startArr = start.split(":");

// finish
var finish = this.getField("Monday Site #1 Depart Time").value;
var finishArr = finish.split(":");

// difference
var hourDiff = Math.abs(finishArr[0] - startArr[0]);
var minDiff = Math.floor((Math.abs(finishArr[1] - startArr[1]) / 60)*100);

if (minDiff.toString().length == 1) 
    minDiff = '0' + minDiff;

var output = hourDiff + "." + minDiff;
event.value = output;

if ((event.value == "") || (event.value == Infinity) || isNaN(event.value)) {

  event.value = "";}

```

**To calculate the total site time (total manhours for the specific site) I used this:**

```
var t1 = this.getField("WS1 Total").value;
var t2 = this.getField("WS1 Total").value;
var t3 = this.getField("WS1 Total").value;
event.value = t1+t2+t3

```