field_attach_form_validate

  1. drupal
    1. drupal7
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.

  • Widget validation steps are specific to a given widget's own form

structure and UI metaphors. They are executed through FAPI's #element_validate property during normal form validation.

  • Field validation steps are common to a given field type, independently of

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.

Übergabeparameter

$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.

Verwandte Themen

▾ 3 functions call field_attach_form_validate()

field_test_entity_form_validate in modules/simpletest/tests/field_test.module
Validate handler for field_test_set_field_values().
node_form_validate in modules/node/node.pages.inc
user_profile_form_validate in modules/user/user.pages.inc
Validation function for the user account and profile editing form.

Code

modules/field/field.autoload.inc, line 141

<?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

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen