Figure 1: Create A New Module

1. Module Name: Give a name to your module.
2. Select "JavaScripting" module and click Create.

Figure 2: Select Module to Add JavaScript

Timesheet Example:

Calculate the number of hours worked when employee times out at the end of a working day. Example, an employee timed IN at 0800 and timed OUT at 1800. To find out the number of hours worked, we will perform a simple substraction below:
time OUT minus time IN and roundup the result Below is our calculation script

Line 1: a = form.timeOut.value;
Line 2: hrsWorked = a-form.timeIn.value;
Line 3: form.hrsWorked.value = Math.ceil(hrsWorked);

Above script has 3 lines, enter each portion of the line in the fields provided. See example below. To save, click + Append Line button

Figure 3: Line 1

Figure 4: Line 2

Figure 5: Line 3

Figure 6: Editing the Script (Line by Line)

Select Line number to edit from the Dropdown.
Caution! The two sets of 25 long alpha-numeric characters separated by a dot "." represent the FORM-NAME . FIELD-NAME, generated automatically for you. Changing it will invalidate the form and field IDs causing your script to stop working.

Figure 7: Ready to Write Script File

Figure 8: Function Script File

Function Scrip File can be used as a plug-in module to a button inside your form