You are here

function colorpicker_example_callback_form in Colorpicker 6

Same name and namespace in other branches
  1. 5 examples/colorpicker_example.module \colorpicker_example_callback_form()
  2. 6.2 examples/colorpicker_example.module \colorpicker_example_callback_form()
1 string reference to 'colorpicker_example_callback_form'
colorpicker_example_callback in examples/colorpicker_example.module

File

examples/colorpicker_example.module, line 41
Example of a form that uses the colorpicker fields

Code

function colorpicker_example_callback_form() {
  $form['colorpicker_example_textfield_1'] = array(
    '#type' => 'colorpicker_textfield',
    '#title' => t('Color picker textfield'),
    '#description' => t('This is a textfield associated with a Farbtastic color picker'),
    '#default_value' => variable_get('colorpicker_example_textfield_1', '#ff33dd'),
  );
  $form['colorpicker_example_textfield_2'] = array(
    '#type' => 'colorpicker_textfield',
    '#title' => t('Color picker textfield 2'),
    '#description' => t('This is another textfield associated with a Farbtastic color picker'),
    '#default_value' => variable_get('colorpicker_example_textfield_2', '#eedd55'),
  );
  $form['colorpicker_example_textfield_3'] = array(
    '#type' => 'colorpicker_textfield',
    '#title' => t('Color picker textfield 3'),
    '#description' => t('This is another textfield associated with a Farbtastic color picker'),
    '#default_value' => variable_get('colorpicker_example_textfield_3', '#cccccc'),
  );
  $form['colorpicker_example_textfield_4'] = array(
    '#type' => 'colorpicker_textfield',
    '#title' => t('Color picker textfield 4'),
    '#description' => t('This is another textfield associated with a Farbtastic color picker'),
    '#default_value' => variable_get('colorpicker_example_textfield_4', '#000000'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#title' => t('Save'),
    '#description' => t('Save the default values of this form'),
    '#value' => t('Save'),
  );
  return $form;
}