Home Forums General Issues How to update color picker


How to update color picker

  • I’m trying to update a color picker field with a click on a button (in the post edit screen) but it’s not working. The code I’m using (on Chrome console) is:

    jQuery(‘.acf-field-THE-KEY .acf-color_picker > input’).iris( ‘color’, ‘#cdcdcd’);

    I get:

    Uncaught Error: cannot call methods on iris prior to initialization; attempted to call method ‘color’

    I have tried with other elements inside the div.acf-field without success.

    I hope someone can help me. Thank you.

  • Hi @alekstrust

    Thanks for the post.

    This error can pop up when you have not declared your buttons properly, you will need to go through the following jQuery resource page and make some changes to your code.

    I hope this information proves helpful.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘How to update color picker’ is closed to new replies.