API page: http://api.drupal.org/api/drupal/developer%21topics%21forms_api_referenc...

Under the section for '#submit':

> rather than the default form validation function which is the form ID with _submit appended to it.

A validation function ends in _validate, never _submit.

That said, I am not entirely sure what this is MEANT to say, as I am not sure how one switches between the two possibilities described earlier in the same sentence:

> This is usually to add additional submit functions to a form, or to use an alternate function

Comments

joachim’s picture

... especially in light of this code:

    // If the triggering element specifies "button-level" validation and submit
    // handlers to run instead of the default form-level ones, then add those to
    // the form state.
    foreach (array('validate', 'submit') as $type) {
      if (isset($form_state['triggering_element']['#' . $type])) {
        $form_state[$type . '_handlers'] = $form_state['triggering_element']['#' . $type];
      }
    }

Seems to me that if a button element specifies a #submit, then it's not going to get the form's basic submit handlers, and there's no other way to do it.

jhodgdon’s picture

Project: Drupal core » Documentation
Version: 8.x-dev »
Component: documentation » API documentation files
Issue tags: +FAPI reference

This file is in the Documentation git repository.