function ajax_forms_test_lazy_load_form_submit

Form submit handler: Adds JavaScript and CSS that wasn't on the original form.

1 string reference to 'ajax_forms_test_lazy_load_form_submit'
AJAXFrameworkTestCase::testLazyLoad in modules/simpletest/tests/ajax.test
Test that new JavaScript and CSS files added during an AJAX request are returned.

File

modules/simpletest/tests/ajax_forms_test.module, line 502

Code

function ajax_forms_test_lazy_load_form_submit($form, &$form_state) {
    if ($form_state['values']['add_files']) {
        drupal_add_js(array(
            'ajax_forms_test_lazy_load_form_submit' => 'executed',
        ), 'setting');
        drupal_add_css(drupal_get_path('module', 'system') . '/system.admin.css');
        drupal_add_js(drupal_get_path('module', 'system') . '/system.js');
    }
    $form_state['rebuild'] = TRUE;
}

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