hi :)
i want to know how can i put multiple color pickers in my form, i need 3 color pickers, i put the 3 color pickers in my form but, if i have more than one color picker they have no effect.
sorry my bad english, and thanks by the help :)
hi :)
i want to know how can i put multiple color pickers in my form, i need 3 color pickers, i put the 3 color pickers in my form but, if i have more than one color picker they have no effect.
sorry my bad english, and thanks by the help :)
Comments
Comment #1
thiagomoraesp commentedhi guys :)
i solved it.
we need to use the #colorpicker value as the colorpicker name in the colorpicker_textfield something like:
$form['cabecalho']['cor_de_fundo']['colorpickerfundo'] = array(
'#type' => 'colorpicker',
'#title' => 'Cores',
'#description' => 'seletor de cores',
//the id of my colorpicker is 'colorpickerfundo'
);
$form['cabecalho']['cor_de_fundo']['cor_do_fundo'] = array(
'#type' => 'colorpicker_textfield',
'#title' => 'Cor do Fundo',
'#default_value' => '#000000',
'#description' => 'cor',
'#colorpicker' => 'colorpickerfundo', //the #colorpicker propierty need to be equal the colopicker name.
i hope it be very usefull for somebody, i search a lot about this is the internet but i don't find anything.
);
Comment #2
dwees commentedYes, that's exactly correct. Good deduction, looks like we need better documentation in the README.
Comment #3
thiagomoraesp commentedfor more details, the module have a folder that have samples of this :)