I'm simply trying to submit a node add form via AJAX:
function input_form_alter(&$form, &$form_state, $form_id) {
switch ($form_id) {
case 'page_node_form':
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
'#ajax' => array(
'wrapper' => 'apple-node-form',
'callback' => 'node_add_callback',
'method' => 'replace',
'effect' => 'fade'
)
);
break;
}
return;
}
function node_add_callback(){
$node = new stdClass();
$node->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.