function form_builder_unset_element in Form Builder 6
Same name and namespace in other branches
- 7 includes/form_builder.api.inc \form_builder_unset_element()
Recursive function to unset an element within a form structure.
1 call to form_builder_unset_element()
- form_builder_cache_field_delete in includes/
form_builder.cache.inc - Remove a single field from a form builder cache.
File
- includes/
form_builder.api.inc, line 258 - form_builder.api.inc Universally used API functions within the Form builder module.
Code
function form_builder_unset_element(&$form, $element_id) {
foreach (element_children($form) as $key) {
if (isset($form[$key]['#form_builder']['element_id']) && $form[$key]['#form_builder']['element_id'] == $element_id) {
unset($form[$key]);
break;
}
form_builder_unset_element($form[$key], $element_id);
}
}