Append a Drupal form table For the past few days I have been trying to update a rather simple table with ajax.  The table cannot be rebuilt.  This is of my own accord, if the table is rebuilt all of the colors data that was already put in is ruined.  The table must remain unchanged, only appended on.

Drupal's append does not seem to give me this functionality.  Even if I set up the form and theming properly the big issue is that on submit the node will not recognize the new data.  It only accepts that which was built on start and my appends although showing up on the screen do not show up at all on submit.  Each input is not named either despite being put in.  I cannot figure out what is going on here.  This is just a mess...  Please help.

IN HOOK_FORM

$form['recipe_ingredients']['recipe_more_ingredients'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; t('More ingredients'),
    '#description' =&gt; t("If the amount of boxes above isn't enough, click here to add more ingredients."),
    '#weight' =&gt; 1,
    '#submit' =&gt; array('recipe_more_ingredients_submit'),
    '#limit_validation_errors' =&gt; array(),
    '#ajax' =&gt; array(
      'callback' =&gt; 'recipe_more_ingredients_js',
      'wrapper' =&gt; 'thistobe',
      'effect' =&gt; 'fade',
      'method' =&gt; 'append'
),
);


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

    $form['recipe_ingredients']['ing'][$id] = array(
        '#theme' =&gt; 'ingredients_row',
    );

    $form['recipe_ingredients']['ing'][$id]['quantity'] = array(
        '#type' =&gt; 'textfield',
        '#title' =&gt; t('Quantity'),
        '#size' =&gt; 8,
        '#maxlength' =&gt; 8,
        '#attributes' =&gt; array('class' =&gt; array('form-item-recipe-ingredients-quantity')),
);

  return $form['recipe_ingredients']['ing'][$id];
 }
All changes to form must be done through hook_form.  Adding a new form in a js callback function will not be accepted as new elements to a form in Drupal.