drupal_submit_form

  1. drupal
    1. 4.7
    2. 5
Versions
4.7 drupal_submit_form($form_id, $form, $callback = NULL)
5 drupal_submit_form($form_id, $form)

Related topics

▾ 1 function calls drupal_submit_form()

drupal_get_form in includes/form.inc
Processes a form array and produces the HTML output of a form. If there is input in the $_POST['edit'] variable, this function will attempt to validate it, using drupal_validate_form(), and then submit the form using drupal_submit_form().

Code

includes/form.inc, line 201

<?php
function drupal_submit_form($form_id, $form, $callback = NULL) {
  global $form_values;
  $default_args = array($form_id, &$form_values);

  if (isset($form['#submit'])) {
    foreach ($form['#submit'] as $function => $args) {
      if (function_exists($function)) {
        $args = array_merge($default_args, (array) $args);
        // Since we can only redirect to one page, only the last redirect will work
        $redirect = call_user_func_array($function, $args);
        if (isset($redirect)) {
          $goto = $redirect;
        }
      }
    }
  }
  return $goto;
}
?>