Trying to submit a node add form via AJAX but failing I'm simply trying to submit a node add form via AJAX:

function input_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  switch ($form_id) {
    case 'page_node_form':
      $form['actions']['submit'] = array(
        '#type' =&gt; 'submit',
        '#value' =&gt; t('Submit'),
        '#ajax' =&gt; array(
            'wrapper' =&gt; 'apple-node-form',
            'callback' =&gt; 'node_add_callback',
            'method' =&gt; 'replace',
            'effect' =&gt; 'fade'
        )
      );
      break;
  }
  return;
}

function node_add_callback(){
  $node = new stdClass();
  $node-&gt;type = 'page';
  return drupal_get_form('node_form', $node);
}


input_form_alter() DOES get called. And when I click the submit button, I even see the standard ajax gif and "Please wait" message. The gif and wait message then disappear, as expected. However, no new node has actually been created.
Solved it. The problem was this code:

  $form['actions']['submit'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; t('Submit'),
    '#ajax' =&gt; array(
        'wrapper' =&gt; 'apple-node-form',
        'callback' =&gt; 'node_add_callback',
        'method' =&gt; 'replace',
        'effect' =&gt; 'fade'
    )
  );


This overwrites the $form['actions']['submit'] array that already existed, recreating it with the values I specified. Since all I wanted to do was add an AJAX submission, the following code should replace the above:

    $form['actions']['submit']['#ajax'] = array(
        'wrapper' =&gt; 'apple-node-form',
        'callback' =&gt; 'node_add_callback',
        'method' =&gt; 'replace',
        'effect' =&gt; 'fade'
    );


In other words, we're just adding an #ajax item to the already created $form['actions']['submit'] array.