How do I alter a form using an AJAX callback?
Ajax Forms in Drupal 7 states:


  Changes to the form must only be made in the form builder function. The callback function must not alter the form or any other state.


In form build/alter, check $form_state-&gt;getTriggeringElement() for the triggering element and then enable the field.