You are here

function webform_ajax_callback in Webform Ajax 7.2

Same name and namespace in other branches
  1. 7 webform_ajax.module \webform_ajax_callback()

AJAX callback for Webform Prev/Next page and Submit buttons.

Returns the newly computed webform, unless the submission is complete or the user is being redirected for some other reason.

1 string reference to 'webform_ajax_callback'
webform_ajax_form_webform_client_form_alter in ./webform_ajax.module
Implements hook_form_FORM_ID_alter().

File

./webform_ajax.module, line 149
Webform AJAX module file.

Code

function webform_ajax_callback($form, &$form_state) {
  $output = array();

  // If user completed his submission, determine what to do.
  if (!empty($form_state['webform_completed']) && empty($form_state['save_draft'])) {
    $output = _webform_ajax_callback_completed($form, $form_state);
  }
  elseif (!empty($form_state['redirect'])) {
    $output = _webform_ajax_callback_completed($form, $form_state);
  }
  else {
    $output = $form;
  }
  return $output;
}