function form_test_storage_element_validate_value_cached
Form element validation handler for 'value' element in form_test_storage_form().
Tests updating of cached form storage during validation.
1 string reference to 'form_test_storage_element_validate_value_cached'
- form_test_storage_form in modules/
simpletest/ tests/ form_test.module - A multistep form for testing the form storage.
File
-
modules/
simpletest/ tests/ form_test.module, line 840
Code
function form_test_storage_element_validate_value_cached($element, &$form_state) {
// If caching is enabled and we receive a certain value, change the storage.
// This presumes that another submitted form value triggers a validation error
// elsewhere in the form. Form API should still update the cached form storage
// though.
if (isset($_REQUEST['cache']) && $form_state['values']['value'] == 'change_title') {
$form_state['storage']['thing']['changed'] = TRUE;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.