I had found an example of using a callback

onEnd : function() {
alert('i ended');

But didn't know where to put it.

Then when I looked at the new Control.ColorPicker line:

 new Control.ColorPicker("colorfield4",
       {IMAGE_BASE : "/images/", "swatch" : "colorbox4"}

 I realized I could include it in the options hash - I had just never
done that sort of thing before, so as well getting a good color picker
for my project, I have now learned something new.

I put this in the hash

onClose : function() {alert('i changed it to '+ this.field.value);}

and it worked!

On Mar 5, 11:47 am, Tonypm <> wrote:
> Hi,
> Need help about using callbacks I don't know if anyone has used
> colorpickerjs
> It seems to be a great little colorpicker utility based on
> scriptaculous.
> I have got it working, but would like to hook into one of the
> callbacks to dynamically change the color of a text element on the
> page.  The summary page refers to four callbacks, but I cant for the
> life of me figure out how to access them.
> I have tried accessing the callbacks from the button or the input, but
> suspect I need to directly access the control but don't know how.
> My js knowledge is a bit limited; I have done some reading on
> callbacks but have to admit to being somewhat befuddled.
> Thanks for any help
> Tonypm

You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to