2022.1

Table Of Contents
Using the COTG plugin
A Capture OnTheGo (COTG) Form may contain special COTG input elements, like a
Signature, Geolocation, or Camera element. These elements do not function without the COTG
JavaScript library. It is this library that links the controls with hardware features on the mobile
device.
The COTG JavaScript library offers options and custom events for COTG widgets to support
event-based programming in Capture OnTheGo Forms. For example: your code can
automatically set a date for a Date field and retrieve the Geolocation as soon as a form has
been signed.
All available options and events are listed in the Capture OnTheGo API: "Capture OnTheGo
API" on page652.
Note
Options and custom events were not available in the cotg-1.x.js versions of the library.
They have been introduction in version 2.0.0 with Connect 1.8.
With OL Connect 2021.1 the COTG library has been updated to version 2.1.0 to support
nested fields tables in COTG Fields Table elements. This also fixed an issue with the
COTG Camera Widget that occurred when it was used in a COTG Fields Table.
This topic explains in detail how to add the COTG plugin, how to change the defaults for COTG
widgets and how to use events.
How to add COTG elements to a Form dynamically is explained in another topic: "Dynamically
adding COTG widgets" on page642.
It is assumed that you have a basic understanding of HTML forms, CSS, JavaScript, and
jQuery. Examples on this page use jQuery.
About jQuery
This version of the COTG library is entirely based on jQuery. jQuery is a JavaScript library that
makes it very easy to select elements in a web page using HTML and CSS selectors, and to
manipulate those elements. You will need to use jQuery to dynamically add widgets to a COTG
Form. If you are new to it, spend a few minutes on learning it - it's that easy. For more
information, see: https://jquery.com/. and http://learn.jquery.com/.
Page 639