This page provides a programmer's reference to the Backdrop CMS Form API. For a brief introduction on how to create forms, see the Form generation guide. For more extensive information about the Form API, see the Form API handbook (Drupal 7 documentation).

Skip to: Default Values | Elements | Properties

Input elements

buttoncheckboxcheckboxescolordateemailfilehtml_datehtml_datetimehtml_timeimage_buttonlink_fieldmachine_namemanaged_filenumberoptionspasswordpassword_confirmradioradiosrangesearchselectsubmittableselectteltextareatextfieldtext_formaturlweight
#access
#after_build
#ajax
#array_parents
#attached
#attributes
#autocomplete_path
#base_type
#browser_view
#button_type
#children
#cols
#default_value
#default_value_allowed
#default_value_pattern
#delta
#description
#disabled
#editor_uploads
#element_validate
#empty
#empty_option
#empty_value
#executes_submit_callback
#extended
#field_prefix
#field_suffix
#format
#has_garbage_value
#header
#id
#input
#js_select
#key_type
#key_type_toggle
#key_type_toggled
#limit
#limit_validation_errors
#max
#maxlength
#min
#multiple
#name
#optgroups
#options
#options_readonly
#parents
#password_shown
#password_strength
#password_toggle
#placeholder
#post_render
#prefix
#pre_render
#process
#progress_indicator
#progress_message
#required
#resizable
#return_value
#rows
#size
#src
#states
#step
#submit
#suffix
#theme
#theme_wrappers
#title
#title_display
#tree
#type
#upload_location
#upload_validators
#validate
#value
#value_callback
#weight

Structure elements

actionsajaxcontainercontextual_linksdetailsdropbuttonfieldsetformhead_taghelphiddenitemlinkmarkupoperationsscriptsstylestokenvaluevertical_tabs
#access
#action
#after_build
#aggregate_callback
#ajax
#attached
#attributes
#children
#collapsed
#collapsible
#commands
#config
#default_tab
#default_value
#description
#details
#disabled
#element_validate
#error
#group
#group_callback
#header
#https
#id
#items
#links
#markup
#method
#open
#options
#parents
#post_render
#prefix
#pre_render
#process
#required
#states
#submit
#suffix
#summary
#tag
#theme
#theme_wrappers
#title
#title_display
#tree
#type
#validate
#value
#weight

Default values

Every element automatically has these default values (see system_element_info()):

The following is a list of default values which do not need to be set (found in system_element_info):

actions

ajax

button

checkbox

checkboxes

color

container

contextual_links

  • #attached = array('library' => array( array( 'contextual', 'contextual-links', ), ))
  • #attributes = array('class' => array( 'contextual-links', ))
  • #prefix = <div class="contextual-links-wrapper">
  • #pre_render = array('contextual_pre_render_links')
  • #suffix = </div>
  • #theme = links__contextual
  • #links = array()

date

details

dropbutton

email

fieldset

file

form

head_tag

help

hidden

html_date

html_datetime

html_time

image_button

item

link

  • #pre_render = array('backdrop_pre_render_link', 'backdrop_pre_render_markup')

link_field

machine_name

managed_file

markup

number

operations

  • #pre_render = array('backdrop_pre_render_dropbutton')
  • #theme = links__dropbutton__operations

options

password

password_confirm

  • #process = array('form_process_password_confirm', 'user_form_process_password_confirm')
  • #size = 60
  • #theme_wrappers = array('form_element')

radio

radios

range

scripts

search

select

styles

submit

tableselect

tel

textarea

textfield

text_format

token

url

vertical_tabs

weight

Elements

Properties