1.8

Table Of Contents
All available options and events are listed in the Capture OnTheGo API: "Capture OnTheGo
API" on page453.
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 page445.
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/.
Adding the plugin
When you create a template with a COTG Template Wizard (see "Capture OnTheGo template
wizards" on page416), the Designer automatically adds the jQuery library and the COTG
library: cotg-2.0.0.js.
This also happens when you add a Capture OnTheGo (COTG) element to a template that you
didn't start with a COTG template wizard.
If a template contains an earlier version of the COTG library, the newest version will be added
to the resources, but you will be asked which version of the library you prefer to use. Your
preferred library will be included in the section (see: "Includes dialog" on page682).
When this library is included in a Web template instead of a COTG template, it won't affect the
template, except when the user submits a Form. At that moment the plugin will automatically
add a hidden field for every unchecked checkbox on the Form.
Tip
If you want to take a look at the contents, you can open the plugin within the Designer: double-click
cotg-2.0.0.js on the Resources pane.
Page 443