...
Each sourceField
element represents a single data field that is required for the data source. The fieldList
element contains a list of sourceField
sourceFields
elements, which, in totality, represent all the fields required for the data source.
sourceField
sourceFields
element are:name
- contains the name of the field. This name is used when the data fields are passed tosetFields
. Because of this, the names can be a little long. Theid
is the suggestedid
for the field if it is rendered in HTML. The names are also prefixed with "greenid_" in order to avoid name clashes with anything else that might be on the customer's page.label
- please see the section about Labels.type
- indicates the type of the field, and this corresponds to an HTML input field type. Most fields are "text" fields. In the example above, thegreenid_nswregodvs_tandc
field is a checkbox, which should be rendered using an HTML checkbox input field.value
- contains any pre-existing value. For example, from the snippet above, thegreenid_nswregodvs_givenname
field has a pre-existing value of "Test". Customers should include this value when rendering HTML input fields.
Each sourceField
sourceFields
element also contains a list of attribute
elements. These attributes are intended to be applied to HTML input fields that are rendered to gather input from the person being verified. The name
element is the intended name of the attribute, and the value
element is the intended value of the attribute. For example, from the snippet above, the greenid_nswregodvs_number
input field is intended to have the HTML attributes "id='greenid_nswregodvs_number' class='required'"
applied when rendered in HTML.
The goal is that a customer can read the fieldList
element and get enough information to render HTML dynamically. Of course, given that the fields and their names are not subject to frequent change, their values can be assumed.
The sourceFields
element also contains an element called rawData
that contains a pre-rendered HTML fragment that can be used directly by the customer, if desired. From the example above, the rawData
element contains:
Code Block | ||
---|---|---|
| ||
<rawData><![CDATA[<?xml version="1.0"?> <sourcefields> <div class="row"> <div class="form-group col-sm-3"> <label for="greenid_nswregodvs_number" class="control-label">{{{nswregodvs_number_label}}} <span class="greenid-helpicon" title="{{{nswregodvs_number_tooltip}}}"> <span class="greenid-sr-only">{{{nswregodvs_number_tooltip}}}</span> </span> </label> <input type="text" name="greenid_nswregodvs_number" id="greenid_nswregodvs_number" class="required" value=""/> </div> </div> <div class="row"> <div class="form-group col-sm-4"> <label for="greenid_nswregodvs_givenname">{{{nswregodvs_givenname_label}}}</label> <input type="text" name="greenid_nswregodvs_givenname" id="greenid_nswregodvs_givenname" class="form-control namevalidation required" value="Test"/> </div> <div class="form-group col-sm-4"> <label for="greenid_nswregodvs_surname">{{{nswregodvs_surname_label}}}</label> <input type="text" name="greenid_nswregodvs_surname" id="greenid_nswregodvs_surname" class="form-control namevalidation required" value="McTestie"/> </div> </div> <div class="row"> <div class="form-group col-sm-3"> <label for="greenid_nswregodvs_dob">{{{nswregodvs_dob_label}}}</label> <input type="text" name="greenid_nswregodvs_dob" id="greenid_nswregodvs_dob" class="form-control dobvalidation required" value="01/02/1980"/> </div> </div> <div class="checkbox"> <label for="greenid_nswregodvs_tandc"> <input type="checkbox" name="greenid_nswregodvs_tandc" id="greenid_nswregodvs_tandc" class="required"/> {{{nswregodvs_tandc_label}}}</label> </div> </sourcefields>]]> </rawData> |
...