function overlay_form_alter

Implements hook_form_alter().

File

modules/overlay/overlay.module, line 84

Code

function overlay_form_alter(&$form, &$form_state) {
    // Add a hidden element to prevent dropping out of the overlay when a form is
    // submitted inside the overlay using a GET method.
    if (isset($form['#method']) && $form['#method'] == 'get' && isset($_REQUEST['render']) && $_REQUEST['render'] == 'overlay' && !isset($form['render'])) {
        $form['render'] = array(
            '#type' => 'hidden',
            '#value' => 'overlay',
        );
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.