function webform_validation_get_field_keys in Webform Validation 6
Same name and namespace in other branches
- 7 webform_validation.module \webform_validation_get_field_keys()
Recursive helper function to get all field keys (including fields in fieldsets)
1 call to webform_validation_get_field_keys()
- webform_validation_validate in ./
webform_validation.module - Webform validation handler to validate against the given rules
File
- ./
webform_validation.module, line 180
Code
function webform_validation_get_field_keys($submitted, $node) {
static $fields = array();
foreach (element_children($submitted) as $child) {
if (is_array($submitted[$child]) && element_children($submitted[$child])) {
// only keep searching recursively if it's a fieldset
$group_components = _webform_validation_get_group_types();
if (in_array(_webform_validation_get_component_type($node, $child), $group_components)) {
webform_validation_get_field_keys($submitted[$child], $node);
}
else {
$fields[$child] = $child;
}
}
else {
$fields[$child] = $child;
}
}
return $fields;
}