1 ajax_example_node_form_alter.inc ajax_example_node_prepare($node)

Implements hook_node_prepare().

See also

ajax_example_form_node_form_alter()

File

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

Code

function ajax_example_node_prepare($node) {
  if (empty($node->ajax_example)) {
    // Set default values, since this only runs when adding a new node.
    $node->ajax_example['example_1'] = 0;
    $node->ajax_example['example_2'] = '';
  }
}