Unlimited value fields numbered Is it possible to show a numbered output to an unlimited value field (in the input form rather than the display). 

Basically I have a field collection and I'd like to show by the side of each one entered a count, so if you write one it looks like

1 | field_one
  | field_two
  | field_three


Then if you added another it would look like

1 | field_one
  | field_two
  | field_three
2 | field_one
  | field_two
  | field_three


and so on...

I'm trying to think where you'd go about doing this, I can't see anything that counts out how many values it has when looking at the $form array in the page itself, and I wouldn't have thought it'd be something that you can do via a template file.

Can this be done?
Wow that was much harder to do than I really thought it would be, for anyone interested in how to do this, you can use the information below, in case anyone is interested I've taken most of the information from this site about how to remove the drag handles, but the principle is the same, added to which, I wanted to remove the drag handles anyway

First you have to create your own module, and use hook_theme_registry_alter to change where the default theming is defined for multiple value fields

/**
 * Implements hook_theme_registry_alter().
 */
function mymodule_theme_registry_alter(&amp;$theme_registry) {
  if (isset($theme_registry['field_multiple_value_form'])) {
    $theme_registry['field_multiple_value_form']['type'] = 'module';
    $theme_registry['field_multiple_value_form']['theme path'] = drupal_get_path('module', 'mymodule');
    $theme_registry['field_multiple_value_form']['function'] = 'mymodule_theme_field_multiple_value_form';
  }
}


Then you can re-define how it's themed by copying the existing theme_field_multiple_value_form code and writing it into your new function. BUT, be aware that this is going to redefine how ALL unlimited field values work, so really you just want to add in an 'if' clause somewhere, I just put mine at the start

function mymodule_theme_field_multiple_value_form($variables) {
  $element = $variables['element'];
  $output = '';

  if (($element['#cardinality'] &gt; 1 || $element['#cardinality'] == FIELD_CARDINALITY_UNLIMITED) &amp;&amp; $element['#field_name'] != 'field_myfield') {

  // Input normal code, this is for any unlimited input field you DON'T want altering

  } else if (($element['#cardinality'] &gt; 1 || $element['#cardinality'] == FIELD_CARDINALITY_UNLIMITED) &amp;&amp; $element['#field_name'] == 'field_myfield') {

$table_id = drupal_html_id($element['#field_name'] . '_values');
$required = !empty($element['#required']) ? theme('form_required_marker', $variables) : '';

$header = array(
  array(
    'data' =&gt; '&lt;label&gt;' . t('!title !required', array('!title' =&gt; $element['#title'], '!required' =&gt; $required)) . "&lt;/label&gt;",
    'colspan' =&gt; 2,
    'class' =&gt; array('field-label'),
  ),
);
$rows = array();

// Sort items according to '_weight' (needed when the form comes back after
// preview or failed validation)
$items = array();
foreach (element_children($element) as $key) {
  if ($key === 'add_more') {
    $add_more_button = &amp;$element[$key];
  }
  else {
    $items[] = &amp;$element[$key];
  }
}
usort($items, '_field_sort_items_value_helper');

$count = 1;
// Add the items as table rows.
foreach ($items as $key =&gt; $item) {
  unset($item['_weight']);
  $cells = array(
    array(
      'data' =&gt; $count,
      'class' =&gt; array('count'),
    ),
    drupal_render($item),
  );
  $rows[] = array(
    'data' =&gt; $cells,
  );

  $count++;
}

$output = '&lt;div class="form-item"&gt;';
$output .= theme('table', array('header' =&gt; $header, 'rows' =&gt; $rows, 'attributes' =&gt; array('id' =&gt; $table_id, 'class' =&gt; array('field-multiple-table'))));
$output .= $element['#description'] ? '&lt;div class="description"&gt;' . $element['#description'] . '&lt;/div&gt;' : '';
$output .= '&lt;div class="clearfix"&gt;' . drupal_render($add_more_button) . '&lt;/div&gt;';
$output .= '&lt;/div&gt;';


  } else {
      foreach (element_children($element) as $key) {
        $output .= drupal_render($element[$key]);
      }
    }

    return $output;
  }


Hope this helps someone in the future