function ajax_example_node_by_author_autocomplete_submit
Submit handler for node lookup unique autocomplete example.
Here the nid has already been placed in $form_state['values']['node'] by the validation handler.
Parameters
array $form: Form API form.
array $form_state: Form API form state.
Return value
array Form API array.
File
-
ajax_example/
ajax_example_autocomplete.inc, line 412
Code
function ajax_example_node_by_author_autocomplete_submit($form, &$form_state) {
$node = node_load($form_state['values']['node']);
$account = user_load($node->uid);
drupal_set_message(t('You found node %nid with title !title_link, authored by !user_link', array(
'%nid' => $node->nid,
'!title_link' => l($node->title, 'node/' . $node->nid),
'!user_link' => theme('username', array(
'account' => $account,
)),
)));
}