You are here

function ahah_example_dropdown_callback in Examples for Developers 6

The AHAH callback. It processes the form using ahah_example_callback_helper() and then

1 string reference to 'ahah_example_dropdown_callback'
ahah_example_menu in ahah_example/ahah_example.module
Implement hook_menu().

File

ahah_example/ahah_example_dependent_dropdown.inc, line 81
Show/hide textfields based on checkbox clicks.

Code

function ahah_example_dropdown_callback() {
  $form = ahah_example_callback_helper();
  $changed_elements = $form['dependent_dropdown_holder'];

  // Prevent duplicate wrappers.
  unset($changed_elements['#prefix'], $changed_elements['#suffix']);
  $output = theme('status_messages') . drupal_render($changed_elements);
  drupal_json(array(
    'status' => TRUE,
    'data' => $output,
  ));
}