How to embed a color picker as question? | XM Community
Skip to main content
Solved

How to embed a color picker as question?

  • November 20, 2018
  • 9 replies
  • 413 views

Forum|alt.badge.img+3
Dear Community! I wonder if it's possible to embed a RGB/HSV color picker as a question. In my survey the participants shall be asked to pick a color from a palette and the value (or at least the HEX codes) of the selected colour shall be saved. It is my first survey, I am really not experienced in these kinds of things. I would appreciate your help very much! Thanks!

Best answer by TomG

@overtone, See this thread: https://www.qualtrics.com/community/discussion/comment/7727#Comment_7727
View original

9 replies

Akdashboard
Level 4 ●●●●
Forum|alt.badge.img+6
  • Level 4 ●●●●
  • 488 replies
  • November 20, 2018
It would be a little tedious, but you can do this with hot spot question type. Each color would be a separate zone. You can also do it with a hot spot question, so that the respondent doesn't see the zone you created (in case it doesn't look good).

Akdashboard
Level 4 ●●●●
Forum|alt.badge.img+6
  • Level 4 ●●●●
  • 488 replies
  • November 20, 2018
Reading up on this, there is probably a MUCH better way to do this with a JQuery. @TomG is a pretty good resource.

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • Answer
  • November 20, 2018
@overtone, See this thread: https://www.qualtrics.com/community/discussion/comment/7727#Comment_7727

Forum|alt.badge.img+3
  • Author
  • Level 2 ●●
  • 11 replies
  • November 27, 2018
Thank you TomG! It works perfectly!

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • November 27, 2018
> @overtone said: > Thank you TomG! It works perfectly! @Shashi deserves the credit. Be sure to give his answer an upvote.

Forum|alt.badge.img+1
  • 4 replies
  • June 20, 2024

Hi @TomG @overtone. I am not sure I can still find the original comment in hte thread you linked here as answer. Any advice on how to have color picker as question? thanks


Forum|alt.badge.img+1
  • 2 replies
  • October 28, 2024

Hi @TomG and @overtone 

 

I am looking at this conversation thread and would like to know how embed a question to pick a colour into our survey.  The thread seems to have disappeared.  Could you point me in the right direction to find it?

Thank you

Tracey


Shashi
Level 8 ●●●●●●●●
Forum|alt.badge.img+32
  • Level 8 ●●●●●●●●
  • 633 replies
  • October 28, 2024

In a form field question with two fields, use the below script:

var cinput = jQuery("#"+this.questionId+" .InputText:eq(1)");
	var hinput = jQuery("#"+this.questionId+" .InputText:eq(0)");
	hinput.attr("readonly","readonly").css({"pointer-events":"none"});
	cinput.attr("type","color").css({"width":"10%","height":"45px"});
	cinput.change(function() {
      	const color = jQuery(this).val(); // Get the selected color value
     	hinput.val(color);
    });

Output:

 


Forum|alt.badge.img+1
  • 2 replies
  • October 28, 2024

Thank you @Shashi.

 

So to clarify, each participant can choose a colour for the background?

 

Thank you so much.

 

Tracey


Leave a Reply