Form API Reference 元素參數對照表

1 篇文章 / 0 new
author
Form API Reference 元素參數對照表
Form 控制參數

Form Controls 1

Legend:
X = attribute can be used with this type
- = attribute is not applicable to this type

#type checkbox checkboxes date fieldset file machine
_name
managed_file password password
_confirm
#access X X X X X X X X X
#after_build X X X X X X X X X
#ajax X X - - - X - - -
#array_parents X X X X X X X X X
#attached X X X X X X X X X
#attributes X X X X X X X X -
#autocomplete_path - - - - - X - - -
#collapsed - - - X - - - - -
#collapsible - - - X - - - - -
#cols - - - - - - - - -
#default_tab - - - - - - - - -
#default_value X X X - - X - - -
#delta - - - - - - - - -
#description X X X X X X X X X
#disabled X X X - X X X X X
#element_validate X X X X X X X X X
#empty - - - - - - - - -
#empty_option - - - - - - - - -
#empty_value - - - - - - - - -
#field_prefix X - - - - X - X X
#field_suffix X - - - - X - X X
#group - - - X - - - - -
#header - - - - - - - - -
#type checkbox checkboxes date fieldset file machine
_name
managed_file password password
_confirm
#js_select - - - - - - - - -
#maxlength - - - - - X - X -
#multiple - - - - - - - - -
#options - X - - - - - - -
#parents X X X X X X X X X
#post_render X X X X X X X X X
#prefix X X X X X X X X X
#pre_render X X X X X X X X X
#process X X X X X X X X X
#required X X X - X X - X X
#resizable - - - - - - - - -
#return_value X - - - - - - - -
#rows - - - - - - - - -
#size - - - - X X - X X
#states X X X X X X X X X
#suffix X X X X X X X X X
#theme X X X X X X X X X
#theme_wrappers X X X X X X X X X
#title X X X X X X X X X
#title_display X X X X X X X X X
#tree X X X X X X X X X
#value_callback X X X X X X X X X
#weight X X X X X X X X X
 

Form Controls 2

#type radio radios select tableselect text_format textarea textfield vertical_tabs weight
#access X X X X X X X X X
#after_build X X X X X X X X X
#ajax X X X X X X X - -
#array_parents X X X X X X X X X
#attached X X X X X X X X X
#attributes X X X X X X X - X
#autocomplete_path - - - - - - X - -
#collapsed - - - - - - - - -
#collapsible - - - - - - - - -
#cols - - - - X X - - -
#default_tab - - - - - - - X -
#default_value X X X X X X X - X
#delta - - - - - - - - X
#description X X X - X X X - X
#disabled X X X - X X X - X
#element_validate X X X X X X X X X
#empty - - - X - - - - -
#empty_option - - X - - - - - -
#empty_value - - X - - - - - -
#field_prefix X - X - - X X - -
#field_suffix X - X - - X X - -
#group - - - - - - - - -
#header - - - X - - - - -
#type radio radios select tableselect text_format textarea textfield vertical_tabs weight
#js_select - - - X - - - - -
#maxlength - - - - - - X - -
#multiple - - X X - - - - -
#options - X X X - - - - -
#parents X X X X X X X X X
#post_render X X X X X X X X X
#prefix X X X X X X X X X
#pre_render X X X X X X X X X
#process X X X X X X X X X
#required X X X - X X X - X
#resizable - - - - X X - - -
#return_value X - - - - - - - -
#rows - - - - X X - - -
#size - - X - - - X - -
#states X X X X X X X X X
#suffix X X X X X X X X X
#theme X X X X X X X X X
#theme_wrappers X X X X X X X X X
#title X X X - X X X - X
#title_display X X X - X X X - X
#tree X X X X X X X X X
#value_callback X X X X X X X X X
#weight X X X X X X X X X

特殊元素

Special Elements

#type actions button container image_button submit form hidden token markup item value
#access X X X X X X X X X X -
#action - - - - - X - - - - -
#after_build X X X X X X X X X X -
#ajax - X - X X - - - - - -
#attributes X X X X X X - - - - -
#button_type - X - X X - - - - - -
#default_value - - - - - - X X - - -
#description - - - - - - - - - X -
#disabled - X - X X - - - - - -
#element_validate - X - X X - X X X X -
#executes_submit
_callback
- X - X X - - - - - -
#limit_validation_errors - X - X X - - - - - -
#markup - - - - - - - - X X -
#method - - - - - X - - - - -
#name - X - - X - - - - - -
#parents X X X X X - X X X X -
#post_render X X X X X X X X X X -
#prefix X X X X X X X X X X -
#pre_render X X X X X X X X X X -
#process X X X X X X X X X X -
#return_value - - - X - - - - - - -
#src - - - X - - - - - - -
#submit - X - X X X - - - - -
#suffix X X X X X X X X X X -
#theme X X X X X X X X X X -
#theme_wrappers X X X X X X X X X X -
#title - - - - - - - - - X -
#title_display - - - - - - - - - X -
#tree X X X X X X X X X X -
#validate - X - X X X - - - - -
#value - X - X X - X X - - X
#weight X X X X X - X X X X -
#type actions button container image_button submit form hidden token markup item val

預設值

Default Values

詳細預設值可查閱 (system_element_info()): 下為常用項目的預設值內容:

 

from http://api.drupal.org/api/drupal/developer!topics!forms_api_reference.ht...
Free Web Hosting