Static field works, dynamically modified element gets lost I'm new to Drupal forms - trying to figure out a maddening problem.

I have a content type of 'doc-upload' with various fields including 'publisher_code'.

When I define the 'publisher_code' field type to 'text', and go through my upload process, yada yada yada, the value appears in my $node structure later as expected.

When I change 'publisher_code' to "field type: List (text), widget: Select list", and I try to dynamically populate that element with:

function mymodule_form_doc_upload_node_form_alter(&amp;$form, &amp;$form_state) {

  $publishers = array( 'pub1' =&gt; 'Publisher 1', 'pub2' =&gt; 'Publisher 2' );

  $form['field_publisher_code'] = array(
    '#title' =&gt; t('Select a publisher'),
    '#type' =&gt; 'select',
    '#options' =&gt; $publishers,
    '#multiple' =&gt; FALSE,
    '#empty_value' =&gt; '',
    '#empty_option' =&gt; '- None -',
    '#required' =&gt; TRUE
  );
}


The form displays properly, but when the form is submitted, the 'field_publisher_code' doesn't come out the other side - presumably it's getting filtered/invalidated somewhere, but I can't seem to find where?
instead of over writing the form element just edit variables you want to change something like below

  $publishers = array( 'pub1' =&gt; 'Publisher 1', 'pub2' =&gt; 'Publisher 2' );

  $form['field_publisher_code']['#type'] = 'select';
  $form['field_publisher_code']['#options'] = $publishers;
  $form['field_publisher_code']['#multiple'] = FALSE;


I presume your $form already has the variable when you get the form.