Multi choice question with text entry | XM Community
Solved

Multi choice question with text entry

  • 26 July 2023
  • 4 replies
  • 44 views

Userlevel 3
Badge +3

Hello everyone, 

I hope you are doing good !

 

I am new to Qualtrics and I just used this JavaScript technique which worked perfectlly well. There is only one question label which I would like to display in my survey do you know what should I add to this code “jQuery(“label”).hide();”. 

 

Here’s below the question I’m working on : 

So to be clear I would like to hide the question labels of the first 5 items and let the 6th one visible do you guys know what should I add to the code : jQuery(“label”).hide(); 

 

Thank you in advance for your help :) 

icon

Best answer by Tom_1842 26 July 2023, 17:55

View original

4 replies

Userlevel 7
Badge +27

Try using this. It will hide all labels except for a specific one. As each answer option has 2 label elements, the 6th answer option’s label will be indexed at 11. I also added a line that will make the TextEntryBox elements span the question container while on desktop.

jQuery("#"+this.questionId+" label").not(":eq(11)").hide();

jQuery("#"+this.questionId+" .TextEntryBox").css("width", "100%");

 

Userlevel 6
Badge +18

Hi @Tata C ,

 

Instead of adding the script in the JavaScript option add the script as follows:

 

  1. Go to answer option → Rich content editor → HTML view.
  2. Paste the below code in all boxes except box 6.
  3. <script>jQuery(“label”).hide()</script>
  4. Make sure you don't have this code in question level JS option.

 

Hope this works.

Userlevel 3
Badge +3

Hi @Tom_1842

Thank you very much for your answer it worked very well as you can see below :)

 

 

Userlevel 3
Badge +3

Hi @SaurabhPujare_Ugam,

Thank you for your help :)

 

This option helps to hide the question label in the survey builder but not in preview, but thanks I found how to do it with the help of @Tom_1842 

 

Thank you guys !

Leave a Reply