Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Tejas Shah on Jun 30, 2008 07:26
open dhtmlx forum
DHTMLX ColorPicker : How to show the selected color in the colorbox after retrieving from database.

Hi,
I want to show the selected color in colorbox after I retrieve the value of RGB combination from say database. I am using DHTMLX Suite Commercial Version.

For example, <input type="text" colorbox="true" id="colopicker1"/>

Suppose I get value from database like #a9b2e5, then I want to display that color in the colorbox.

How to do this ?

Answer posted by Support on Jun 30, 2008 09:58
setColor method can be used to set current color

var cp = dhtmlXColorPickerInput(....
....
cp.setColor("#A9B2E5");   //to update colorpicker
cp.onSelectHandler.apply(cp,cp.getSelectedColor()); //to update data in input