Initialization with attachment to input
You can define colorPicker properties right through INPUT element attributes in HTML:
You can define colorPicker properties right through INPUT element attributes in HTML:
<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxcolorpicker.css" /> <style> .cs_colorBox { float:right; } </style> <script src="../../codebase/dhtmlxcommon.js"></script> <script src="../../codebase/dhtmlxcolorpicker.js"></script> <script></script> <div><input type="text" imagepath="../../codebase/imgs/" id="dhtmlxColorPicker1"></div><br> <div><input type="text" imagepath="../../codebase/imgs/" colorbox="true" id="dhtmlxColorPicker2"></div><br> <div><input type="text" imagepath="../../codebase/imgs/" customcolors="true" selectonclick="true" id="dhtmlxColorPicker3"></div>function initColorPicker() { var myCP1 = new dhtmlXColorPickerInput('dhtmlxColorPicker1'); myCP1.setImagePath("../../codebase/imgs/"); myCP1.init(); var myCP2 = new dhtmlXColorPickerInput('dhtmlxColorPicker2'); myCP2.setImagePath("../../codebase/imgs/"); myCP2.init(); var myCP3 = new dhtmlXColorPickerInput('dhtmlxColorPicker3'); myCP3.setImagePath("../../codebase/imgs/"); myCP3.init(); }