Why won't my custom content field update on save/edit? I am building a custom content type programmatically within my module. Everything appears as I thought it would on the "Add Content" page, but whenever I create a new piece of content or edit the created content the data from the field is not being saved. When I go back into the content nothing is there.

What am I missing? Is there a better approach? I wanted to keep the scope of this module inside of the related "Add Content" page because it needs to be able to follow the Drupal Workbench workflow.

On .install:

function header_maker_enable(){
  $contentType = "brand_header";
  $readableType = "Brand Header";
  $type = node_type_load($contentType);

  //Verify that the content type has not already been created once for this module
  if(!$type){
    $type = array(
      'type' =&gt; $contentType,
      'name' =&gt; t($readableType),
      'base' =&gt; 'node_content',
      'description' =&gt; t("Test"),
      'custom' =&gt; 1,
      'modified' =&gt; 1,
      'locked' =&gt; 0,
    );

   $type = node_type_set_defaults($type);

   //Creating Custom Test Field
   $field = array(
    'field_name' =&gt; 'brand_header_config',
    'type' =&gt; 'text',
    'entity_types' =&gt; array('node'),
  );
  $field = field_create_field($field);
  $instance = array(
    'field_name' =&gt; 'brand_header_config',
    'entity_type' =&gt; 'node',
    'bundle' =&gt; 'brand_header',
    'label' =&gt; t('Test Field'),
    'widget' =&gt; array('type' =&gt; 'text_textfield'),
  );
  $instance = field_create_instance($instance);

  node_type_save($type);
}

}


Here is my .module file. Something a bit more tricky is going on here with some JS. Basically I am rendering a UI to create some JSON. That JSON is then being added to the input field that was created on install in real time.

function header_maker_form_brand_header_node_form_alter(&amp;$form, $form_state, $form_id){
  if ($form_id == 'brand_header_node_form') {
  $form['header_maker_ui'] = array(
    '#prefix' =&gt; '&lt;div class="header-builder"&gt;',
    '#suffix' =&gt; '&lt;/div&gt;', 
  );
  $form['header_maker_render'] = array(
    '#prefix' =&gt; '&lt;div class="header-render"&gt;',
    '#suffix' =&gt; '&lt;/div&gt;', 
  );

$order = array(
'header_maker_render',  
'brand_header_node_form',
'brand_header_config'
  );

  foreach ($order as $key =&gt; $field) {
// Set/Reset the field's 
// weight to the array key value
// from our order array. 
$form[$field]['#weight'] = $key;
  }
  }
  return $form;
  }

function header_maker_preprocess_page(&amp;$vars, $hook){
  if(isset($vars['page']['content']['system_main']['#form_id'])){
$formid = $vars['page']['content']['system_main']['#form_id'];
if($formid == "brand_header_node_form"){
  drupal_add_css(drupal_get_path('module', 'header_maker'). '/css/brand-header-form.css', array('group' =&gt; CSS_THEME, 'every_page' =&gt; FALSE));
  drupal_add_js(drupal_get_path('module', 'header_maker') . '/js/header_maker.js');
}
}
}
I figured out what my issue was. In order to force users to use the UI I set the input field as being disabled from my JS file.

 document.getElementById('edit-brand-header-config-und-0-value').disabled = true; 


Apparently setting it to disabled prevents it from being stored even though I could add a value to it programmatically through JS.

Removing "disabled = true"