vinaysaini Posted November 13, 2014 Share Posted November 13, 2014 Hi , I am trying to add a color picker field in my module by using form helper. But it is not working, I think I am doing something wrong. Here is my code: array( 'type' => 'color', 'label' => $this->l('Color'), 'name' => 'THEME_BG_COLOR' ), The code generated on the browser is <div class="input-group"> <input type="color" data-hex="true" class="color mColorPickerInput" name="THEME_BG_COLOR" value="#344545"> </div> When I change the color it does not reflect in value field. What am i missing here? Link to comment Share on other sites More sharing options...
Mr Rick Posted November 13, 2014 Share Posted November 13, 2014 Checkout controllers/admin/AdminStatusesController.php, it has color picker. Link to comment Share on other sites More sharing options...
vinaysaini Posted November 14, 2014 Author Share Posted November 14, 2014 I have checked that in AdminStatusesController they are also using array( 'type' => 'color', 'label' => $this->l('Color'), 'name' => 'TK_THEME_BG_COLOR' ), But when I am using this it is not working. It is acting as default html5 input type color as shown in attachment. 1 Link to comment Share on other sites More sharing options...
martinkokes.cz Posted November 9, 2016 Share Posted November 9, 2016 I have checked that in AdminStatusesController they are also using array( 'type' => 'color', 'label' => $this->l('Color'), 'name' => 'TK_THEME_BG_COLOR' ), But when I am using this it is not working. It is acting as default html5 input type color as shown in attachment. the color picker jquery plugin needs older version of jQuery. With version 3.1.1 it was not working. I tested it with jQuery 2.0.0 and it works. You can set it at bottom of file /config/defines.inc.php if (!defined('_PS_JQUERY_VERSION_')) { define('_PS_JQUERY_VERSION_', '2.0.0'); } Link to comment Share on other sites More sharing options...
Recommended Posts