Same name and namespace in other branches
- 4.6.x includes/common.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. See the reference at http://api.drupal.org/api/HEAD/file/developer/topics/forms_api_reference... and the quickstart guide at http://api.drupal.org/api/HEAD/file/developer/topics/forms_api.html
File
- includes/
form.inc, line 3
Functions
Name | Location | Description |
---|---|---|
element_property |
includes/ |
Check if the key is a property. |
element_properties |
includes/ |
Get properties of a form tree element. Properties begin with '#'. |
element_child |
includes/ |
Check if the key is a child. |
element_children |
includes/ |
Get keys of a form tree element that are not properties (i.e., do not begin with '#'). |
drupal_get_form |
includes/ |
Processes a form array and produces the HTML output of a form. If there is input in the $_POST['edit'] variable, this function will attempt to validate it, using drupal_validate_form(), and then submit the form using drupal_submit_form(). |
drupal_validate_form |
includes/ |
|
drupal_submit_form |
includes/ |
|
_form_validate |
includes/ |
|
form_set_error |
includes/ |
File an error against a form element. If the name of the element is edit[foo][bar] then you may pass either foo or foo][bar as $name foo will set an error for all its children. |
form_get_errors |
includes/ |
Return an associative array of all errors. |
form_get_error |
includes/ |
Return the error message filed against the form with the specified name. |
form_error |
includes/ |
Flag an element as having an error. |
form_builder |
includes/ |
Adds some required properties to each form element, which are used internally in the form api. This function also automatically assigns the value property from the $edit array, provided the element doesn't already have an assigned value. |
form_set_value |
includes/ |
Use this function to make changes to form values in the form validate phase, so they will be available in the submit phase in $form_values. |
_form_set_value |
includes/ |
Helper function for form_set_value(). |
form_render |
includes/ |
Renders a HTML form given a form tree. Recursively iterates over each of the form elements, generating HTML code. This function is usually called from within a theme. To render a form from within a module, use drupal_get_form(). |
_form_sort |
includes/ |
Function used by uasort in form_render() to sort form by weight. |
_element_info |
includes/ |
Retrieve the default properties for the defined element type. |
form_options_flatten |
includes/ |
|
theme_select |
includes/ |
Format a dropdown menu or scrolling selection box. |
form_select_options |
includes/ |
|
theme_fieldset |
includes/ |
Format a group of form items. |
theme_radio |
includes/ |
Format a radio button. |
theme_radios |
includes/ |
Format a set of radio buttons. |
theme_password_confirm |
includes/ |
Format a password_confirm item. |
expand_password_confirm |
includes/ |
|
password_confirm_validate |
includes/ |
Validate password_confirm element. |
theme_date |
includes/ |
Format a date selection element. |
expand_date |
includes/ |
Roll out a single date element. |
date_validate |
includes/ |
Validates the FAPI date type to stop dates like 30/Feb/2006 |
map_month |
includes/ |
Helper function for usage with drupal_map_assoc to display month names. |
checkboxes_value |
includes/ |
Helper function to load value from default value for checkboxes |
weight_value |
includes/ |
If no default value is set for weight select boxes, use 0. |
expand_radios |
includes/ |
Roll out a single radios element to a list of radios, using the options array as index. |
theme_item |
includes/ |
Format a form item. |
theme_checkbox |
includes/ |
Format a checkbox. |
theme_checkboxes |
includes/ |
Format a set of checkboxes. |
expand_checkboxes |
includes/ |
|
theme_submit |
includes/ |
|
theme_button |
includes/ |
|
theme_hidden |
includes/ |
Format a hidden form field. |
theme_token |
includes/ |
|
theme_textfield |
includes/ |
Format a textfield. |
theme_form |
includes/ |
Format a form. |
theme_textarea |
includes/ |
Format a textarea. |
theme_markup |
includes/ |
Format HTML markup for use in forms. |
theme_password |
includes/ |
Format a password field. |
theme_weight |
includes/ |
Format a weight selection menu. |
theme_file |
includes/ |
Format a file upload field. |
_form_set_class |
includes/ |
Sets a form element's class attribute. |
form_clean_id |
includes/ |
Remove invalid characters from an HTML ID attribute string. |