function nodeformsettings_settings_validate in Node and Comments Form Settings 7.2
Same name and namespace in other branches
- 6.3 nodeformsettings.module \nodeformsettings_settings_validate()
- 6.2 nodeformsettings.module \nodeformsettings_settings_validate()
We use this function to validate.
The reason why we don't use '#element_validate' in each form field is because with this we have option to $form_state and with #element_validate we only have access to the element that calls que validation function.
1 string reference to 'nodeformsettings_settings_validate'
- nodeformsettings_form_alter in ./
nodeformsettings.module - Implements hook_form_alter().
File
- ./
nodeformsettings.module, line 151
Code
function nodeformsettings_settings_validate($form, &$form_state) {
$path = drupal_get_path('module', 'nodeformsettings') . '/includes/';
// Get all the elements defined in the function.
$elements = nodeformsettings_elements_validate();
// Loop thought the array to build the function.
foreach ($elements as $key) {
include_once DRUPAL_ROOT . '/' . $path . 'validate_' . $key . '.inc';
$function = '_validate_' . $key;
if (function_exists($function)) {
$function($form, $form_state);
}
}
}