1 ajax_example_node_form_alter.inc ajax_example_node_insert($node)

Implements hook_node_insert().

See also

ajax_example_form_node_form_alter()

File

modules/examples/ajax_example/ajax_example_node_form_alter.inc, line 109
This example shows how to use AJAX when altering a node form.

Code

function ajax_example_node_insert($node) {
  if (isset($node->ajax_example)) {
    db_insert('ajax_example_node_form_alter')
      ->fields(array(
        'nid' => $node->nid,
        'example_1' => $node->ajax_example['example_1'],
        'example_2' => $node->ajax_example['example_2'],
      ))
      ->execute();
  }
}