Drupal7 forms_api_reference.html

来源:互联网 发布:js实现放大镜效果 编辑:程序博客网 时间:2024/05/16 08:57

http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/7

Form Controls

图例:

X= 可以被这个类型使用
- = 不能被这个类型使用

#typecheckboxcheckboxesdatefieldsetfilemachine_namemanaged_filepasswordpassword_confirmradioradiosselecttableselecttext_formattextareatextfieldvertical_tabsweight#accessXXXXXXXXXXXXXXXXXX#access#after_buildXXXXXXXXXXXXXXXXXX#after_build#ajaxXX---X---XXXXXXX--#ajax#array_parentsXXXXXXXXXXXXXXXXXX#array_parents#attachedXXXXXXXXXXXXXXXXXX#attached#attributesXXXXXXXX-XXXXXXX-X#attributes#autocomplete_path-----X---------X--#autocomplete_path#collapsed---X--------------#collapsed#collapsible---X--------------#collapsible#cols-------------XX---#cols#default_tab----------------X-#default_tab#default_valueXXX--X---XXXXXXX-X#default_value#delta-----------------X#delta#descriptionXXXXXXXXXXXX-XXX-X#description#disabledXXX-XXXXXXXX-XXX-X#disabled#element_validateXXXXXXXXXXXXXXXXXX#element_validate#empty------------X-----#empty#empty_option-----------X------#empty_option#empty_value-----------X------#empty_value#field_prefixX----X-XXX-X--XX--#field_prefix#field_suffixX----X-XXX-X--XX--#field_suffix#group---X--------------#group#header------------X-----#header#typecheckboxcheckboxesdatefieldsetfilemachine_namemanaged_filepasswordpassword_confirmradioradiosselecttableselecttext_formattextareatextfieldvertical_tabsweight#type#js_select------------X-----#js_select#maxlength-----X-X-------X--#maxlength#multiple-----------XX-----#multiple#options-X--------XXX-----#options#parentsXXXXXXXXXXXXXXXXXX#parents#post_renderXXXXXXXXXXXXXXXXXX#post_render#prefixXXXXXXXXXXXXXXXXXX#prefix#pre_renderXXXXXXXXXXXXXXXXXX#pre_render#processXXXXXXXXXXXXXXXXXX#process#requiredXXX-XX-XXXXX-XXX-X#required#resizable-------------XX---#resizable#return_valueX--------X--------#return_value#rows-------------XX---#rows#size----XX-XX--X---X--#size#statesXXXXXXXXXXXXXXXXXX#states#suffixXXXXXXXXXXXXXXXXXX#suffix#themeXXXXXXXXXXXXXXXXXX#theme#theme_wrappersXXXXXXXXXXXXXXXXXX#theme_wrappers#titleXXXXXXXXXXXX-XXX-X#title#title_displayXXXXXXXXXXXX-XXX-X#title_display#treeXXXXXXXXXXXXXXXXXX#tree#value_callbackXXXXXXXXXXXXXXXXXX#value_callback#weightXXXXXXXXXXXXXXXXXX#weight


特殊元素

#typeactionsbuttoncontainerimage_buttonsubmitformhiddentokenmarkupitemvalue#accessXXXXXXXXXX-#action-----X-----#after_buildXXXXXXXXXX-#ajax-X-XX-X----#attributesXXXXXX-----#button_type-X-XX------#default_value------XX---#description---------X-#disabled-X-XX------#element_validate-X-XX-XXXX-#executes_submit_callback-X-XX------#limit_validation_errors-X-XX------#markup--------XX-#method-----X-----#name-X--X------#parentsXXXXX-XXXX-#post_renderXXXXXXXXXX-#prefixXXXXXXXXXX-#pre_renderXXXXXXXXXX-#processXXXXXXXXXX-#return_value---X-------#src---X-------#submit-X-XXX-----#suffixXXXXXXXXXX-#themeXXXXXXXXXX-#theme_wrappersXXXXXXXXXX-#title---------X-#title_display---------X-#treeXXXXXXXXXX-#validate-X-XXX-----#value-X-XX-XX--X#weightXXXXX-XXXX-#typeactionsbuttoncontainerimage_buttonsubmitformhiddentokenmarkupitemvalue

默认值Default Values

每个元素自动拥有这些默认值(见system_element_info()):

  • #description = NULL
  • #attributes =array()
  • #required = FALSE
  • #tree = FALSE
  • #parents =array()

下面是一个并不需要设置(在system_element_info()中 )的默认值的列表:

 

  • button
    • #name = 'op'
    • #button_type = 'submit'
    • #executes_submit_callback = FALSE
    • #ajax['event'] = 'mousedown'
  • checkbox
    • #return_value = 1
    • #ajax['event'] = 'change'
    • #title_display = 'after'
  • checkboxes
    • #tree = TRUE
  • fieldset
    • #collapsible = FALSE
    • #collapsed = FALSE
  • file
    • #size = 60
  • form

·   

    • #method = 'post'
    • #action =request_uri()
  • image_button
    • #button_type = 'submit'
    • #executes_submit_callback = TRUE
    • #ajax['event'] = 'mousedown'
  • radio

·   

    • #ajax['event'] = 'change'
    • #title_display = 'after'
  • password

·   

    • #size = 60
    • #maxlength = 128
    • #ajax['event'] = 'blur'
  • password_confirm

·   

    • #size = 60
  • submit

·   

    • #name = 'op'
    • #button_type = 'submit'
    • #executes_submit_callback = TRUE
    • #ajax['event'] = 'mousedown'
  • textarea
    • #cols = 60
    • #resizable = TRUE
    • #rows = 5
    • #ajax['event'] = 'blur'
  • textfield

·   

    • #size = 60
    • #maxlength = 128
    • #autocomplete_path = FALSE
    • #ajax['event'] = 'blur'
  • weight
    • #delta = 10