Form generation

  1. drupal
    1. 4.6 includes/common.inc
    2. 4.7 includes/form.inc
    3. 5 includes/form.inc

Functions to enable output of HTML forms and form elements.

Drupal uses these functions to achieve consistency in its form presentation, while at the same time simplifying code and reducing the amount of HTML that must be explicitly generated by modules.

Functions & methods

NameDescription
formGenerate a form from a set of form elements.
form_buttonFormat an action button.
form_checkboxFormat a checkbox.
form_checkboxesFormat a set of checkboxes.
form_fileFormat a file upload field.
form_get_errorsReturn an associative array of all errors.
form_groupFormat a group of form items.
form_hiddenStore data in a hidden form field.
form_itemFormat a general form item.
form_passwordFormat a single-line text field that does not display its contents visibly.
form_radioFormat a radio button.
form_radiosFormat a set of radio buttons.
form_selectFormat a dropdown menu or scrolling selection box.
form_set_errorFile an error against the form element with the specified name.
form_submitFormat a form submit button.
form_textareaFormat a multiple-line text field.
form_textfieldFormat a single-line text field.
form_tokenGenerate a form token based on the session and the private key to defend against cross site request forgeries.
form_weightFormat a weight selection menu.
_form_get_class
_form_get_errorReturn the error message filed against the form with the specified name.

File

includes/common.inc, line 968
Common functions that many Drupal modules will need to reference.

Login or register to post comments