form_set_value

5 form.inc form_set_value($form, $value)
6 form.inc form_set_value($form_item, $value, &$form_state)
7 form.inc form_set_value($element, $value, &$form_state)
8 form.inc 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

4 calls to form_set_value()

File

includes/form.inc, line 486

Code

function form_set_value($form, $value) {
  global $form_values;
  _form_set_value($form_values, $form, $form['#parents'], $value);
}
Login or register to post comments