Quicksketch.org Drupal Demos
Navigation
AJAX Poll Example
Form builder example
User login
Username:
*
Password:
*
Request new password
AJAX Poll Example
Which browser do you use most regularly?:
Internet Explorer
Firefox
Safari
Chrome
Opera
Home
›
Form builder example
Form builder example
Edit
Export
Export code:
$form = array(); $form['sample_textfield'] = array( '#size' => '20', '#weight' => '0', '#field_suffix' => ' :Suffix', '#field_prefix' => 'Prefix: ', '#type' => 'textfield', '#title' => 'Sample textfield', '#default_value' => 'a sample value', ); $form['sample_checkboxes'] = array( '#weight' => '1', '#multiple' => '1', '#default_value' => array( '0' => 'two', ), '#options' => array( 'one' => 'one', 'two' => 'two', 'three' => 'three', ), '#type' => 'checkboxes', '#title' => 'Sample checkboxes', ); $form['sample_textarea'] = array( '#weight' => '2', '#default_value' => 'Text area sample value', '#title' => 'Sample textarea', '#type' => 'textarea', ); $form['sample_radios'] = array( '#weight' => '3', '#default_value' => 'two', '#options' => array( 'one' => 'one', 'two' => 'two', 'three' => 'three', ), '#type' => 'radios', '#title' => 'Sample radios', ); $form['sample_select'] = array( '#weight' => '4', '#multiple_toggle' => '1', '#default_value' => 'two', '#options' => array( 'one' => 'one', 'two' => 'two', 'three' => 'three', ), '#type' => 'select', '#title' => 'Sample select', ); return $form;