Multiple select do not save for my custom field with custom widget I'm trying to save multiple values from multi select option form which I created in the custom widget with:

$element['labs'] = array(
  '#type' =&gt; 'select',
  '#options' =&gt; $list,
  '#multiple' =&gt; 'multiple',
  '#title' =&gt; t('Labs'),
);


The biggest problem is the values won't save! As I know the delta should increment automatically if cardinality is set to more than 1.

1) I can't change cardinality or some other setting after activating the field in the edit field form

2) I can't see my custom field in the field type list to select from if I try to alter existing widgets:

'default_widget' =&gt; 'options_select',
'default_formatter' =&gt; 'status_field_options',


How could I extend standard list field type to populate the multiselect with my own generated data?

OR

How could I write my widget that Drupal let me save multiple values with different delta?
The values won't save when you don't have any storage to write into.

Make sure your widget implements hook_field_schema() and provide necessary schema for a field structure in your .install file. E.g.

/**
 * Implements hook_field_schema().
 */
function MYMODULE_field_schema($field) {
  switch ($field['type']) {
    default:
      $columns = array(
        'value' =&gt; array(
          'type' =&gt; 'text',
          'not null' =&gt; FALSE,
        ),
      );
      break;
  }
  return array(
    'columns' =&gt; $columns,
    'indexes' =&gt; array(
      'value' =&gt; array('value'),
    ),
  );
}


Then in hook_field_info() make sure you've FIELD_BEHAVIOR_DEFAULT for multiple values behavior, e.g.

/**
 * Implements hook_field_widget_info().
 */
function MYMODULE_field_field_widget_info() {
  return array(
    'my_widget' =&gt; array(
      'label' =&gt; t('Default'),
      'field types' =&gt; array('select'),
      'behaviors' =&gt; array(
        'multiple values' =&gt; FIELD_BEHAVIOR_DEFAULT,
      ),
    ),
  );
}


When implementing multiple field properties as part of one widget (such as address field), please check: How to override default cardinality for the field widget?

For complete example, check existing modules under field core module or check field_example module (part of Examples).