Api docs work it out pretty well. $form['#submit'] will add an array of submit handlers to your form: i.e. when someone clicks the submit button, the function in the array is called. They will be called after sending .
You usually want to use this property when you call hook_form_alter() to add another submit function to the form that you did not create yourself, as if you created the form yourself in the code, you also create a default value to send the handler. Here are the FAPI documents at #submit .
$form['#after_build'] looks like it takes an array of functions to call, but they will be called after the form is built to display. This can be used if you have a default value or an existing value in the form element and you want to check the status of something with that value before submitting . See FAPI for a good example of checking the status of something before submitting after creating the form to display.
So, in the end, the functions $form['#submit'] will be called when submitted, and the functions $form['#after_build'] will be called when the form is displayed.
jergason
source share