| Versionen | |
|---|---|
| drupal7 | field_attach_form_validate($obj_type, &$object, $form, &$form_state) |
Perform field validation against form-submitted field values.
There are two levels of validation for fields in forms: widget validation, and field validation.
structure and UI metaphors. They are executed through FAPI's #element_validate property during normal form validation.
the specific widget being used in a given form. They are defined in the field type's implementation of hook_field_validate().
This function performs field validation in the context of a form submission. It converts field validation errors into form errors on the correct form elements. Fieldable object types should call this function during their own form validation function.
$obj_type The type of $object; e.g. 'node' or 'user'.
$object The object being submitted. The 'bundle key', 'id key' and (if applicable) 'revision key' should be present. The actual field values will be read from $form_state['values'].
$form The form structure.
$form_state An associative array containing the current state of the form.
This function is an autoloader for _field_attach_form_validate() in modules/field/field.attach.inc.
modules/
<?php
function field_attach_form_validate($obj_type, &$object, $form, &$form_state) {
require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
return _field_attach_form_validate($obj_type, $object, $form, $form_state);
}
?>
Kommentare
Kommentar hinzufügen