Custom field widget form - Multiple values
You can use drupal form api attributes like 



 case 'select':
        $widget += array(
          '#type' =&gt; 'select',
          '#prefix' =&gt; '&lt;div id="' . $settings[$element['#field_name']]['ajax_wrapper'] . '"&gt;',
          '#suffix' =&gt; '&lt;/div&gt;',
          '#options' =&gt; $options,
          '#delta' =&gt; $delta,
          '#element_validate' =&gt; array('_entityreference_hierachy_option_limit_validate'),
          '#default_value' =&gt;  $saved_target_id,
          '#multiple' =&gt; $multiple,
          '#size' =&gt; $multiple ? min(12,count($options)) : 0, 
        );
        break;




https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7#multiple