Definition

form_set_value($form, $value)
drupal-5/includes/form.inc, line 840

Description

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

Namesort iconDescription
Form generationFunctions to enable the processing and display of HTML forms.

Code

<?php
function form_set_value($form, $value) {
  global $form_values;
  _form_set_value($form_values, $form, $form['#parents'], $value);
}
?>