hook_form_alter() adding ajax event I have a custom module that is adding a new field in the form in hook_form_alter().

In my hook_form_alter() I have 

function mymod_form_alter(&amp;$form, &amp;$form_state, $form_id) {
     $form['complaint']['complaint_category'] = array(
        '#type' =&gt; 'select',
        '#title' =&gt; t('Complaint'),
        '#options' =&gt; myfuc(),
        '#required' =&gt; TRUE,
        '#empty_option' =&gt; t('Choose complaint category'),
        '#default_value' =&gt; $selected_complaint_category,
        '#ajax' =&gt; array(
          'callback' =&gt; 'mymod_complaint_dependent_dropdown_callback',
          'wrapper' =&gt; 'dropdown-complaint-remark',
        ),
      );
}


If I add a break point in my code in the function mymod_complaint_dependent_dropdown_callback() it is not triggered. Another element in the form has a #ajaxsetting and a break point on it works.

In the UI no spinner is added to the page. So it looks to me like the ajax event is not being registered. Any ideas?
You could try adding an 'event' item to the ajax array in your FAPI code. The form needs to know when to trigger the ajax callback. The FAPI documentation says you don't have to specify it explicitly but try 'event' => 'change', and see if that works for you. Since you are not specifying it, perhaps the default one that Drupal uses is not right for a select type.  

See https://api.drupal.org/api/drupal/developer%21topics%21forms_api_reference.html/7.x#ajax_event