[development] Searching for AHAH! instead of AHAH?

jeff at ayendesigns.com jeff at ayendesigns.com
Thu Dec 30 06:03:05 UTC 2010


Next issue. My callback isn't being hit when I change the value in the 
master dropdown. I have the code below...simplified, albeit apparently 
wrong. Unlike the examples, the #ahah being added to the field does not 
result in any ahah references in jQuery.extend(Drupal.settings.


function test_menu() {
     $items = array();
     $items['test/dropdown/callback'] = array(
         'page callback' => 'test_do_callback',
         'type' => MENU_CALLBACK,
         'access_callback' => TRUE,
       );

     return $items;
}

function test_form_alter(&$form, &$form_state, $form_id) {
     if ($form_id == 'test_profile_node_form') {
         $form['field_two']['#prefix'] = '<div id="field-two-wrapper">';
         $form['field_two']['#suffix'] = '</div>';

         $form['field_master']['#ahah'] = array(
             'path' => 'test/dropdown/callback',
             'wrapper' => 'field-two-wrapper'
         );
         $form['field_master']['#tree'] = TRUE;
     }
}


function test_do_callback() {

// do stuff here

}



More information about the development mailing list