How to apply one AJAX to all form elements?
I don't believe there's anything 'built in' for that, but a small recursive function would handle it:

function _MYMODULE_apply_ajax(&amp;$element, $ajax) {
  $element['#ajax'] = $ajax;
  foreach (element_children($element) as $key) {
    _MYMODULE_apply_ajax($element[$key], $ajax);
  }
}


Where you apply this kind of depends what you need. You could add it at the end of the form function itself, but if there's a chance your form could be altered it would be best in hook_form_alter(). Either way just call

_MYMODULE_apply_ajax($form, $ajax_array);