2021.2

Table Of Contents
HTML, as you can see on the Source tab in the Designer after making a setting.
All options, including options that cannot be set via the user interface, can be set via this data-
params attribute. To define a timeout of 6 seconds for a Geolocation element, for example, you
could switch to the Source tab and change its HTML to:
<div id="geolocation1" role="cotg.Geolocation" data-params="
{&quot;timeout&quot;:6000}">.
Settings in the HTML override the default settings for that element. They are applied to the
widget when the Form is created and cannot be changed afterwards.
For a complete list of options see the Capture OnTheGo API: "Capture OnTheGo API" on
page622.
Settings for a dynamically added element can be made in code; see "Dynamically adding
COTG widgets" on page611.
The default settings that are specified in the COTG plugin can also be changed in code; see
"Changing default settings for widgets" on page609.
Grouping data using arrays
In a Connect solution, when a Web Form or COTG Form is submitted, there is a Workflow
process that receives the data and creates a job data file (which is an XML file). Having arrays
in the job data file greatly simplifies creating a data mapping configuration and looping over
data in Designer scripts. Here's how to group data in the HTML so that they get submitted as
arrays.
Note
To enable submitting arrays, you need to check the Use PHP arrays or Use enhanced
PHP arrays option in the HTTP Server user preferences in Workflow; see Workflow
Online Help.
A simple method to create arrays in the job data file is to use two pairs of square brackets in
the name of the form inputs. Put the name of the array between the first pair of square brackets.
Between the second pair of square brackets, define the key to which the value belongs.
Consider the following HTML form inputs:
<input type="hidden" name="user_account"
value="pparker@eu.objectiflune.com">
Page 599