Same name and namespace in other branches
- 4.7.x includes/form.inc \form
- 5.x includes/form.inc \form
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.
Parent topics
File
- includes/
common.inc, line 968 - Common functions that many Drupal modules will need to reference.
Functions
Name | Location | Description |
---|---|---|
form |
includes/ |
Generate a form from a set of form elements. |
form_button |
includes/ |
Format an action button. |
form_checkbox |
includes/ |
Format a checkbox. |
form_checkboxes |
includes/ |
Format a set of checkboxes. |
form_file |
includes/ |
Format a file upload field. |
form_get_errors |
includes/ |
Return an associative array of all errors. |
form_group |
includes/ |
Format a group of form items. |
form_hidden |
includes/ |
Store data in a hidden form field. |
form_item |
includes/ |
Format a general form item. |
form_password |
includes/ |
Format a single-line text field that does not display its contents visibly. |
form_radio |
includes/ |
Format a radio button. |
form_radios |
includes/ |
Format a set of radio buttons. |
form_select |
includes/ |
Format a dropdown menu or scrolling selection box. |
form_set_error |
includes/ |
File an error against the form element with the specified name. |
form_submit |
includes/ |
Format a form submit button. |
form_textarea |
includes/ |
Format a multiple-line text field. |
form_textfield |
includes/ |
Format a single-line text field. |
form_token |
includes/ |
Generate a form token based on the session and the private key to defend against cross site request forgeries. |
form_weight |
includes/ |
Format a weight selection menu. |
_form_get_class |
includes/ |
|
_form_get_error |
includes/ |
Return the error message filed against the form with the specified name. |