AJAX event and disable select form element I have a little problem: 

/**
 * Form callback
 */
function ajax_disable_test_form($form, &amp;$form_state) {
  $form['select'] = array(
    '#type' =&gt; 'select',
    '#required' =&gt; FALSE,
    '#title' =&gt; t('Change me!'),
    '#empty_option' =&gt; t('- Select -'),
    '#options' =&gt; drupal_map_assoc(range(1, 3)),
    '#prefix' =&gt; '&lt;div id="select_box_wrapper"&gt;',
    '#suffix' =&gt; '&lt;/div&gt;',
  );
  $form['change'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; t('Change!'),
    '#ajax' =&gt; array(
      'callback' =&gt; 'ajax_disable_test_form_submit_ajax',
      'wrapper' =&gt; 'select_box_wrapper',
    ),
  );
  return $form;
}

/**
 * Ajax callback
 */
function ajax_disable_test_form_submit_ajax($form, $form_state) {
  $form['select']['#title'] = t('Changed!'); // It's work!
  $form['select']['#disabled'] = TRUE; // It's not work!
  return $form['select'];
}


Link: https://gist.github.com/nevergone/23f0a50bee01acc34ed2

If clicked the button, select box title changed, but select box not disabled. Why?
Version: Drupal 7.41
try:

$form['select']['#attributes']['disabled'] = 'disabled';


Ok, a detailed explanation can be found on this article https://www.drupal.org/node/357328

But pretty much resumes to: 


  we cannot simple set the $element['#disabled'] attribute of the
  element. The reason is this attribute is transformed into
  $element['#attributes']['disabled'] by
  _form_builder_handle_input_element executes()...