Automattic / Iris

A(n awesome) Color Picker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Value in field not updating

trinzia opened this issue · comments

Hi,
I am trying to make a function that is called on color change... But the value in the input doesn't update. The text updates, but value stays the same. So I have some trouble calling my function.

Advice?
Thanks!

Please provide example code that illustrates the error or, better yet, link to a test case on http://jsfiddle.net/

I don't know, it won't set up in Fiddle, but if you look at your page: http://automattic.github.com/Iris/
With Firebug (or something that will show you the value, right-click on one of your inputs to inspect it. With the input selected in Firebug, change the color, and the value of the input doesn't change. The text changes but not the value in the input box.

Now if I try to do this I get nothing:

$('#swatch').wpColorPicker({
    hide: false,
    change: function(event, ui) {
        alert('change');
    }
});

If I try to use change(), I get nothing & I think it's because it works from the value of the textbox, not the text of the textbox (is it so?).

$('element').change(function() { // does nothing } );

I also tried various click functions but they weren't happy about it.

So my question is how to do a function when a new color's been chosen. :) Thanks!

Nevermind, it's working now, probably the stupid Firefox Cache. I have got to remember to always use Chrome for testing. Weird that the inspectors in both browsers show changing CSS colors but do not show input value changing.