Form generation

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

NameLocationDescription
formincludes/common.incGenerate a form from a set of form elements.
form_buttonincludes/common.incFormat an action button.
form_checkboxincludes/common.incFormat a checkbox.
form_checkboxesincludes/common.incFormat a set of checkboxes.
form_fileincludes/common.incFormat a file upload field.
form_get_errorsincludes/common.incReturn an associative array of all errors.
form_groupincludes/common.incFormat a group of form items.
form_hiddenincludes/common.incStore data in a hidden form field.
form_itemincludes/common.incFormat a general form item.
form_passwordincludes/common.incFormat a single-line text field that does not display its contents visibly.
form_radioincludes/common.incFormat a radio button.
form_radiosincludes/common.incFormat a set of radio buttons.
form_selectincludes/common.incFormat a dropdown menu or scrolling selection box.
form_set_errorincludes/common.incFile an error against the form element with the specified name.
form_submitincludes/common.incFormat a form submit button.
form_textareaincludes/common.incFormat a multiple-line text field.
form_textfieldincludes/common.incFormat a single-line text field.
form_tokenincludes/common.incGenerate a form token based on the session and the private key to defend against cross site request forgeries.
form_weightincludes/common.incFormat a weight selection menu.
_form_get_errorincludes/common.incReturn the error message filed against the form with the specified name.
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.