form_set_value
- Versions
- 4.7 – 5
form_set_value($form, $value)- 6
form_set_value($form_item, $value, &$form_state)- 7
form_set_value($element, $value, &$form_state)
Use this function to make changes to form values in the form validate phase, so they will be available in the submit phase in $form_values.
Specifically, if $form['#parents'] is array('foo', 'bar') and $value is 'baz' then this function will make $form_values['foo']['bar'] to be 'baz'.
Parameters
$form The form item. Keys used: #parents, #value
$value The value for the form item.
Related topics
Code
includes/form.inc, line 840
<?php
function form_set_value($form, $value) {
global $form_values;
_form_set_value($form_values, $form, $form['#parents'], $value);
}
?>Login or register to post comments 