commit dd12691d33e1566ae7d7f82843777238bc7bba6d Author: Erik Stielstra Date: Tue Mar 25 16:23:01 2014 +0100 #6 diff --git a/developer/topics/forms_api_reference.html b/developer/topics/forms_api_reference.html index b737ca5..92a9aa5 100644 --- a/developer/topics/forms_api_reference.html +++ b/developer/topics/forms_api_reference.html @@ -66,8 +66,12 @@ For more extensive information about the Form API, see the #type checkbox checkboxes + color date + datelist + datetime details + email fieldset file language_select @@ -84,13 +88,18 @@ For more extensive information about the Form API, see the textfield vertical_tabs weight + #type #access X X + X X + X + X X + X X X X @@ -112,8 +121,12 @@ For more extensive information about the Form API, see the #after_build X X + X X + X + X X + X X X X @@ -135,8 +148,12 @@ For more extensive information about the Form API, see the #ajax X X + X - + - + - - + X - - X @@ -159,8 +176,12 @@ For more extensive information about the Form API, see the #array_parents X X + X X + X + X X + X X X X @@ -183,8 +204,12 @@ For more extensive information about the Form API, see the #attached X X + X X + X + X X + X X X X @@ -207,8 +232,12 @@ For more extensive information about the Form API, see the #attributes X X + X X + X + X X + X X X X @@ -230,8 +259,12 @@ For more extensive information about the Form API, see the #autocomplete_path - - + - - + - + - - + X - - - @@ -253,8 +286,12 @@ For more extensive information about the Form API, see the #collapsed - - + - - + - + - X + - X - - @@ -276,8 +313,12 @@ For more extensive information about the Form API, see the #collapsible - - + - - + - + - X + - X - - @@ -299,8 +340,12 @@ For more extensive information about the Form API, see the #cols - - + - - + - + - - + - - - - @@ -319,11 +364,312 @@ For more extensive information about the Form API, see the - #cols + #date_date_callbacks + - + - + - + - + X + X + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +#date_date_callbacks + + #date_date_element + - + - + - + - + - + X + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +#date_date_element + + #date_date_format + - + - + - + - + - + X + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +#date_date_format + + #date_format_string_type + - + - + - + - + - + X + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +#date_format_string_type + + #date_increment + - + - + - + - + X + X + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +#date_increment + + #date_part_order + - + - + - + - + X + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +#date_part_order + + #date_time_callbacks + - + - + - + - + - + X + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +#date_time_callbacks + + #date_time_element + - + - + - + - + - + X + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +#date_time_element + + #date_time_format + - + - + - + - + - + X + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +#date_time_format + + #date_timezone + - + - + - + - + X + X + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +#date_timezone + + #date_year_range + - + - + - + - + X + X + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +#date_year_range + #default_tab - - + - - + - + - - + - - - - @@ -345,8 +691,12 @@ For more extensive information about the Form API, see the #default_value X X + X X + X + X - + X - - X @@ -368,8 +718,12 @@ For more extensive information about the Form API, see the #delta - - + - - + - + - - + - - - - @@ -391,8 +745,12 @@ For more extensive information about the Form API, see the #description X X + X X + X + X X + X X X X @@ -414,8 +772,12 @@ For more extensive information about the Form API, see the #disabled X X + X X + X + X - + X - X X @@ -437,8 +799,12 @@ For more extensive information about the Form API, see the #element_validate X X + X X + X + X X + X X X X @@ -460,8 +826,12 @@ For more extensive information about the Form API, see the #empty - - + - - + - + - - + - - - - @@ -483,8 +853,12 @@ For more extensive information about the Form API, see the #empty_option - - + - - + - + - - + - - - X @@ -506,8 +880,12 @@ For more extensive information about the Form API, see the #empty_value - - + - - + - + - - + - - - X @@ -529,8 +907,12 @@ For more extensive information about the Form API, see the #field_prefix X - + - - + - + - - + - - - X @@ -552,8 +934,12 @@ For more extensive information about the Form API, see the #field_suffix X - + - - + - + - - + - - - X @@ -575,8 +961,12 @@ For more extensive information about the Form API, see the #group - - + - - + - + - X + - X - - @@ -598,8 +988,12 @@ For more extensive information about the Form API, see the #header - - + - - + - + - - + - - - - @@ -621,8 +1015,12 @@ For more extensive information about the Form API, see the #type checkbox checkboxes + color date + datelist + datetime details + email fieldset file language_select @@ -645,8 +1043,12 @@ For more extensive information about the Form API, see the #js_select - - + - - + - + - - + - - - - @@ -668,8 +1070,12 @@ For more extensive information about the Form API, see the #languages - - + - - + - + - - + - - - X @@ -691,8 +1097,12 @@ For more extensive information about the Form API, see the #maxlength - - + - - + - + - - + X - - - @@ -714,8 +1124,12 @@ For more extensive information about the Form API, see the #multiple - - + - - + - + - - + - - - X @@ -737,8 +1151,12 @@ For more extensive information about the Form API, see the #options - X + - - + - + - - + - - - X @@ -760,8 +1178,12 @@ For more extensive information about the Form API, see the #parents X X + X X + X + X X + X X X X @@ -783,8 +1205,12 @@ For more extensive information about the Form API, see the #placeholder - - + - - + - + - - + - - - - @@ -807,8 +1233,12 @@ For more extensive information about the Form API, see the #post_render X X + X X + X + X X + X X X X @@ -830,8 +1260,12 @@ For more extensive information about the Form API, see the #prefix X X + X X + X + X X + X X X X @@ -853,8 +1287,12 @@ For more extensive information about the Form API, see the #pre_render X X + X X + X + X X + X X X X @@ -876,8 +1314,12 @@ For more extensive information about the Form API, see the #process X X + X X + X + X X + X X X X @@ -899,8 +1341,12 @@ For more extensive information about the Form API, see the #required X X + X X + X + X - + X - X X @@ -922,8 +1368,12 @@ For more extensive information about the Form API, see the #resizable - - + - - + - + - - + - - - - @@ -945,8 +1395,12 @@ For more extensive information about the Form API, see the #return_value X - + - - + - + - - + - - - - @@ -968,8 +1422,12 @@ For more extensive information about the Form API, see the #rows - - + - - + - + - - + - - - - @@ -991,8 +1449,12 @@ For more extensive information about the Form API, see the #size - - + - - + - + - - + X - X X @@ -1014,8 +1476,12 @@ For more extensive information about the Form API, see the #states X X + X X + X + X X + X X X X @@ -1037,8 +1503,12 @@ For more extensive information about the Form API, see the #suffix X X + X X + X + X X + X X X X @@ -1060,8 +1530,12 @@ For more extensive information about the Form API, see the #theme X X + X X + X + X X + X X X X @@ -1083,8 +1557,12 @@ For more extensive information about the Form API, see the #theme_wrappers X X + X X + X + X X + X X X X @@ -1106,8 +1584,12 @@ For more extensive information about the Form API, see the #title X X + X X + X + X X + X X X X @@ -1129,8 +1611,12 @@ For more extensive information about the Form API, see the #title_display X X + X X + X + X X + X X X X @@ -1152,8 +1638,12 @@ For more extensive information about the Form API, see the #tree X X + X X + X + X X + X X X X @@ -1175,8 +1665,12 @@ For more extensive information about the Form API, see the #value_callback X X + X X + X + X X + X X X X @@ -1199,8 +1693,12 @@ For more extensive information about the Form API, see the #weight X X + X X + X + X X + X X X X @@ -2050,11 +2548,30 @@ discern checked and unchecked states.

<?php
$form
['high_school']['tests_taken'] = array(
  
'#type' => 'checkboxes',
  
'#options' => drupal_map_assoc(array(t('SAT'), t('ACT'))),
  
'#title' => t('What standardized tests did you take?'),
...
),
?>
+

color

+

Description: +Format a color input element. #default_value uses the six digit hex color format, for example #0779bf.

+ +

Properties: + #access, #after_build, #ajax, #array_parents, #attached, #attributes, + #default_value, #description, #disabled, + #element_validate, #parents, + #post_render, #prefix, + #pre_render, #process, + #required, #states, + #suffix, #theme, #theme_wrappers, + #title, #title_display, + #tree, #type, + #value_callback, #weight

+ +

Usage example:

+
<?php
  $form
['color'] = array(
   
'#type' => 'color',
   
'#title' => t('Color'),
   
'#default_value' => '#0779bf',
  );
?>
+

container

Description: Returns HTML to wrap child elements in a container. Surrounds child elements with a <div> and -adds attributes such as classes or an HTML id. +adds attributes such as classes or an HTML id.

Properties: #access, #after_build, #attributes @@ -2099,6 +2616,66 @@ $fields[$category);
?> +

datelist

+

Description: + Format a collection of individual date and/or time fields. #date_part_order determines which date or time fields will be in the form and their order. Available options: 'month', 'day', 'year', 'hour', 'minute', 'ampm'. + By default a pull-down list is used for the fields. With #date_text_parts, individual fields can be changed into text fields. + More information: datetime_datelist_form_process(). +

+ +

Properties: + #access, #after_build, + #array_parents, #attached, #attributes, + #default_value, #description, + #disabled, #date_date_callbacks, + #date_increment (default: 1), + #date_part_order (default: array('minute')), + #date_timezone, + #date_year_range (default: '1900:2050'), + #element_validate, #parents, #post_render, + #prefix, #pre_render, #process, + #required, #states, + #suffix, #theme, #theme_wrappers, + #title, #title_display, + #tree, #type, + #value_callback, #weight

+ +

Usage example:

+
<?php
  $form
['date'] = array(
   
'#type' => 'datelist',
   
'#default_value' => new DrupalDateTime('2000-01-01 00:00:00'),
   
'#date_part_order' => array('month', 'day', 'year', 'hour', 'minute', 'ampm'),
   
'#date_text_parts' => array('year'),
   
'#date_year_range' => '2010:2020',
   
'#date_increment' => 15,
  );
?>
+ +

datetime

+

Description: + Format a date and/or time field. #date_date_element determines the type of field which is used for date input. Available options: 'datetime', 'datetime-local', 'date', 'text', 'none'. + Similarly, #date_time_element determines the type of field which is used for time input. Available options: 'time', 'text', 'none'. + More information: datetime_datetime_form_process(). +

+ +

Properties: + #access, #after_build, + #array_parents, #attached, #attributes, + #default_value, #description, + #disabled, #date_date_callbacks, + #date_date_callbacks, + #date_date_element (default: 'date'), + #date_date_format (default: 'Y-m-d'), + #date_format_string_type (default: 'php'), + #date_increment (default: 1), + #date_time_callbacks, + #date_time_element (default: 'time'), + #date_time_format (default: 'H:i:s'), + #date_timezone, + #date_year_range (default: '1900:2050'), + #element_validate, #parents, #post_render, + #prefix, #pre_render, #process, + #required, #states, + #suffix, #theme, #theme_wrappers, + #title, #title_display, + #tree, #type, + #value_callback, #weight

+ +

Usage example:

+
<?php
  $form
['date'] = array(
   
'#type' => 'datetime',
   
'#default_value' => new DrupalDateTime('2000-01-01 00:00:00'),
   
'#date_date_element' => 'date',
   
'#date_time_element' => 'none',
   
'#date_year_range' => '2010:+3',
  );
?>
+

details

Description: @@ -2127,6 +2704,25 @@ $form['book'] = array(
); +

email

+

Description: Format an email form field.

+ +

Properties: + #access, #after_build, #ajax, #array_parents, + #attached, #attributes, #autocomplete_path, + #default_value, #description, #disabled, + #element_validate, #maxlength (default: 254), #parents, + #post_render, #prefix, + #pre_render, #process, + #required, #states, #size (default: 60), + #suffix, #theme, #theme_wrappers, + #title, #title_display, + #tree, #type, + #value_callback, #weight

+ +

Usage example (MessageFormController::form):

+
<?php
  $form
['mail'] = array(
   
'#type' => 'email',
   
'#title' => t('Your e-mail address'),
   
'#required' => TRUE,
  );
?>
+

fieldset

Description: