theme

How to add colorpicker to a form textfield

This is how you can add colorpicker to a form textfield for instance in your theme settings file.


drupal_add_css('misc/farbtastic/farbtastic.css');
drupal_add_js('misc/farbtastic/farbtastic.js');

$form['color'] = array(
'#type' => 'textfield',
'#title' => t('Color pickmeup'),
'#default_value' => '#123456',
'#description' => '

',
);

$form['colorpicker_example'] = array(
'#type' => 'item',
'#description' => "

Pages