Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9184611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:05:47+00:00 2026-06-17T19:05:47+00:00

I am using this color picker http://acko.net/blog/farbtastic-jquery-color-picker-plug-in/ Its by steven Though from the docs

  • 0

I am using this color picker http://acko.net/blog/farbtastic-jquery-color-picker-plug-in/
Its by steven

Though from the docs i am using it as

 $(document).ready(function() {

    $('#picker').farbtastic('#color');


  });

And html code is `

`

I have to create it into two separate division. I want color hex value to be changed in input but shows the colour in another division background.

If i use it like this

<div id="colorpicker"></div>
    <input type="text" id="color" name="color" value="#123456" />
    <div id='color' ></div>

The update will take place in one id so in this only input will change with color and its hex value.
From the script http://acko.net/files/farbtastic/demo/farbtastic.js
it takes only one parameter in function so i want this way, that when ever color of division change the color hex value should update under input.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:05:48+00:00Added an answer on June 17, 2026 at 7:05 pm

    You still can’t use two elements with the same ID. It doesn’t work that way. From the script authors web page, passing in the destination ID gives you exactly what the demo does. If you scroll further down, there are instructions where you can pass in a function. This is what you want to do:

    $('#colorpicker').farbtastic(setColors);
    
    var setColors = function(color){
      $('#colorText').val(color);
      $('#colorBackground').css('background-color' : color);
    }
    

    I haven’t tested this, but you should get the point and be on the right road.

    [UPDATE]
    I tested this in a fiddle, and it doesn’t work, though it is exact per the authors documentation. So what you can do is:

    <div id="colorpicker"></div>
    <input type="text" id="colorText" value="#123456" />
    <div id="colorDiv">div<div>
    

    Two seperate ID’s, one for the div, one for the text, and just select them both:

    var domNodes = $('#colorDiv, #colorText');
    $('#colorpicker').farbtastic(domNodes);
    

    Here is the Fiddle



    Also, if you don’t want the input to have the background color at all, you can override the default functionality and do whatever you want like:

    JSFiddle

    $.farbtastic(colorpicker).linkTo(callBack);
    
    function callBack(color) {
        $('#colorText').val(color);
        $('#colorDiv').css('background-color', color);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this jQuery color picker for a CMS theme creator: http://www.eyecon.ro/colorpicker/ They
Im using the color picker here: http://blog.meta100.com/post/600571131/mcolorpicker Im using code shown in example 3.
I've downloaded the Really Simple Color Picker in jQuery from this site I've followed
I am using this file , to choose color, its a nice dialog, I
I am using farbtastic color picker and working fine but now I need to
I'm trying to create a custom composite component colorPicker using this jQuery plugin http://www.eyecon.ro/colorpicker/
i currently need some help, im using [Jquery Minicolors color picker][1] and i wanted
I experience a very weird JavaScript behavior. I'm using jQuery 1.9 and farbtastic color
I'm using this for my link-hover-transition-effect: -webkit-transition: color 250ms ease-in 0; -moz-transition: color 250ms
I have added some animation using jquery but it's not working: $('.test-container').click(function(){ $(this).css('background-color', 'rgb(119,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.