function field_form_get_state
field_form_get_state($parents, $field_name, $langcode, &$form_state)
Retrieves processing information about a field from $form_state.
Parameters
$parents: The array of #parents where the field lives in the form.
$field_name: The field name.
$langcode: The language in which the field values are entered.
$form_state: The form state.
Return value
An array with the following key/data pairs:
- field: the field definition array,
- instance: the field instance definition array,
- items_count: the number of widgets to display for the field,
- array_parents: the location of the field's widgets within the $form structure. This entry is populated at '#after_build' time.
- errors: the array of field validation errors reported on the field. This entry is populated at field_attach_form_validate() time.
See also
File
- modules/field/field.form.inc, line 505
- Field forms management.
Code
function field_form_get_state($parents, $field_name, $langcode, &$form_state) { $form_state_parents = _field_form_state_parents($parents, $field_name, $langcode); return drupal_array_get_nested_value($form_state, $form_state_parents); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!field!field.form.inc/function/field_form_get_state/7.x