function optionwidgets_validate in Content Construction Kit (CCK) 6
Same name and namespace in other branches
- 6.3 modules/optionwidgets/optionwidgets.module \optionwidgets_validate()
- 6.2 modules/optionwidgets/optionwidgets.module \optionwidgets_validate()
FAPI function to validate optionwidgets element.
Transpose selections from field => delta to delta => field, turning multiple selected options into multiple parent elements. Immediate parent is the delta, need to get back to parent's parent to create multiple elements.
3 string references to 'optionwidgets_validate'
- nodereference_select_process in modules/
nodereference/ nodereference.module - Process an individual element.
- optionwidgets_elements in modules/
optionwidgets/ optionwidgets.module - Implementation of FAPI hook_elements().
- userreference_select_process in modules/
userreference/ userreference.module - Process an individual element.
File
- modules/
optionwidgets/ optionwidgets.module, line 270 - Defines selection, check box and radio button widgets for text and numeric fields.
Code
function optionwidgets_validate($element, &$form_state) {
$field = $form_state['#field_info'][$element['#field_name']];
$updated = optionwidgets_form2data($element, $element['#value'], $field);
form_set_value($element, $updated, $form_state);
}