You are here

function ajax_submitter_set in Ajax 6

Sets the submitter

Parameters

$form Assoc:

$found Assoc:

Return value

Bool

1 call to ajax_submitter_set()
ajax_form_alter in ./ajax.module
hook_form_alter

File

./ajax.module, line 159

Code

function ajax_submitter_set(&$form, $found) {
  if (!isset($_POST['drupal_ajax'])) {
    return;
  }
  if (!$found['submitter']) {
    $form['#submit'][] = 'ajax_submitter';
    if (empty($form['#attributes']['class'])) {
      $form['#attributes']['class'] = 'ajax-form';
    }
    else {
      $form['#attributes']['class'] .= ' ajax-form';
    }
  }
  return TRUE;
}