How can I enable JavaScript form validation for AJAX submit buttons? Drupal 8 comes with client-side JavaScript form validation; however, for a submit button with #ajax, it is disabled. How can I enable it?
I had the same question this morning. Here's how I got it to work.

Add an invisible button and specify the #ajax on that.

$form['actions'] = array(
  '#type' =&gt; 'actions',
  'submit' =&gt;array(
    '#type' =&gt; 'submit',
    '#value' =&gt; 'Submit',
  ),
  'validation-hack' =&gt; array(
    '#type' =&gt; 'button',
    '#value' =&gt; 'validated',
    '#attributes' =&gt; array('style' =&gt; 'display:none'),
    '#ajax' =&gt; array(
      'callback' =&gt; array($this, 'doSomething'),
      'event' =&gt; 'click',
      'progress' =&gt; array(
        'type' =&gt; 'throbber',
        'message' =&gt; 'Example...',
      ),
    ),
  ),
);


Then add a submit handler on the form that stops the form submission and then calls click on the hidden button.

  (function($, Drupal) {
    Drupal.behaviors.example = {
      attach: function(context, settings) {
        $(context).find('#example-form-id').submit(function(evt) {
          evt.preventDefault();
          evt.stopPropagation();
          $('#edit-validation-hack').click();
        });
      }
    }
  })(jQuery, Drupal);


Hope this helps you, or anybody else that may stumble across this.