Change Image Alternative text on select box change
I don't think it can be done using AJAX with php, image field doesn't expose the alt as field with value to change it.
But there is a way to do it by using custom Javascript in an AJAX callback like the following:

/**
 * Implements hook_form_alter().
 */
function MODULENAME_form_alter(array &amp;$form, FormStateInterface $form_state, $form_id) {
  $form['field_custom_language']['widget']['#ajax'] = [
    'callback' =&gt; 'AltChange',
    'event'    =&gt; 'change',
    'wrapper'  =&gt; 'edit-field-image-wrapper',
    'progress' =&gt; [
      'type'    =&gt; 'throbber',
      'message' =&gt; t('Loading...'),
    ],
  ];
  // Add library.
  $form['#attached']['library'][] = 'MODULENAME/alter-alt-image';
}


and the callback function should be like:

use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Ajax\InvokeCommand;
function AltChange(array &amp;$form, FormStateInterface $form_state) {
  // Get the language value.
  $lang_code = $form_state-&gt;getValue('field_custom_language')[0]['value'];
  $response = new AjaxResponse();
  $response-&gt;addCommand(new InvokeCommand(NULL, 'AltChange', [$lang_code]));
  return $response;
}


and Then create the library:
MODULENAME.libraries.yml

alter-alt-image:
  version: 1.x
  js:
    js/script.js: {}


and your Js script:
MODULENAME/js/script.js

(function($) {
  // Argument passed from InvokeCommand.
  $.fn.AltChange = function(argument) {
    // Set alt value to the passed arguments.
    $('input#edit-field-image-0-alt').attr('value', argument);
  };
})(jQuery);