This is a Form View addField LIVE select, requiring the owning native LIVE setup and authorization.
Arrays are the newer full, extensible configuration and are preferred for new definitions. Strings remain compatible legacy shorthand/quick syntax. Option keys are specific to each native field type.
addField([
'type' => 'live', 'inputType' => 'select',
'name' => 'STATUS', 'id' => 'item_status', 'label' => 'Status',
'value' => $currentStatus,
'options' => [
['name' => 'Draft', 'value' => 'draft'],
['name' => 'Ready', 'value' => 'ready']
],
'encdata' => [
'TYPE' => 'LIVE', 'DBTABLE' => $dbtable,
'IDFIELD' => $idfield, 'IDVALUE' => $idvalue
]
]);Each name is a displayed label; value is the stored value. The current value is preselected. A missing/unmatched value supplies the native empty choice. showAll and showAllTxt can explicitly request/name an all/empty choice, where appropriate for the field.
For database-backed choices, use optionsdb with actual table, op_name, op_val, optional where and order properties instead of static options. Keep all identifiers/query fragments page-owned. Validate the chosen value and row authorization on the server. Reuse native save transport and acknowledgement.
Table View LIVE selects are configured in td_fields instead; see the full-array nonempty-options example. Do not assume all Form View properties apply to Table View.