fieldMode

FieldmodeDescription
SEARCH Used to attach the suggestions to this field so as a user types address suggestions will appear in a dropdown.
PRESERVE Used to preserve fields from being overwritten with results coming back from selecting an address.
POPULATE Used populate fields based on the returned address components.
COUNTRY Used to populate a country dropdown with a list of countries that can be selected to validate from.

fieldMode Example

Field Mapping

var fields = [
                { element: "iCompany", field: "BusinessName", mode: so.fieldMode.PRESERVE },
                { element: "iAddress1", field: "Address1", mode: so.fieldMode.SEARCH | so.fieldMode.POPULATE },
                { element: "iAddress2", field: "Address2", mode: so.fieldMode.POPULATE },
                { element: "iAddress3", field: "Address3", mode: so.fieldMode.POPULATE },
                { element: "iAddress4", field: "Address4", mode: so.fieldMode.POPULATE },
                { element: "iAddress5", field: "Address5", mode: so.fieldMode.POPULATE },
                { element: "iUnits", field: "SubPremise", mode: so.fieldMode.POPULATE },
                { element: "iLocality", field: "Locality", mode: so.fieldMode.POPULATE },
                { element: "iAdminArea", field: "AdminArea", mode: so.fieldMode.POPULATE },
                { element: "iPostal", field: "PostalCode", mode: so.fieldMode.POPULATE },
                { element: "iCountry", field: "Country", mode: so.fieldMode.COUNTRY}
             ];    

Mapping

Address Control Object

var DOTSGlobalAddressComplete = new so.Address(fields, options);