Closed (fixed)
Project:
Jquery Colorpicker
Version:
6.x-2.1-beta1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
15 Feb 2011 at 01:27 UTC
Updated:
17 Jun 2011 at 06:51 UTC
Hi
Simple patch attached that triggers the jQuery change event on the input once the user alters the color in the picker.
Allows other modules to bind to the change event on the hidden input field and hence react to the change in color.
Example listening to change in field
$('#some-color-field .inner_wrapper .color_picker input').change(function(){
var clr = $(this).val();
//do something with clr
})
| Comment | File | Size | Author |
|---|---|---|---|
| jquery_colorpicker-issue.patch | 431 bytes | larowlan |
Comments
Comment #1
keesee commented** I posted this as a new support issue, but given this patch, I thought you might be able to assist. I apologize for double posting.
Hi there. I have a question and was hoping you might be able to assist me.
I've printed a field for type colorpicker --- field_headcolor
<?php print drupal_render($form['field_headcolor']); ?>When I do that I get exactly what I expect to see. I get a Jquery colorpicker -- drupal renders it so.
What I am wanting to do is have this color picker change an element on the page live.
For example the body or the a div with the id of "example" -- div#example
Is there an easy way to do this? I'm new to javascript and this one is abit beyond my skills at the moment.
Comment #2
aacraig commentedThanks for the patch. Does just what I need.
Comment #3
larowlanAny chance you could mark it as RTBC?
Comment #4
aacraig commentedComment #5
plopescHello
Thank you very much for your help.
This issue has been fixed yet in the git repository, a new release will be rolled as soon as possible.
Regards