Hide the choice and have stars all the way to left | XM Community
Question

Hide the choice and have stars all the way to left

  • 11 December 2023
  • 20 replies
  • 81 views

Userlevel 3
Badge +3

Hello everyone, 

I need some help as I am currently trying to create a survey, as you can see below I would like to hide the choice label and just have the stars all the way to the left I think I can do it with JavaScript but I am not an expert can someone please help.

 

 


20 replies

Userlevel 7
Badge +61

Good afternoon from a rainy Sweden!

If you just do a space (underscore), the label will go away. The stars will not be at the very left still, but there is at least no text there. 

 

At least a partial solution :) 

 

All the best

-Mattias

 

Userlevel 3
Badge +3

Hello @MattiasM 

I am using this Javascrprit below in order to have the stars all the way to the left but it create a huge space between question label and stars is there anyway to reduce the gap  : 

Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId+" tr").each(function() {
var row = jQuery(this);
var th = row.before("<tr></tr>").find("th").attr("colspan","4").css("text-align","left");
row.prev("tr").append(th);
});
});

 

Userlevel 7
Badge +27

@Tata C,

Use this instead:

Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId+" th").hide();
});

 

Userlevel 3
Badge +3

Ok many thanks @TomG I’ll try this :)

Userlevel 3
Badge +3

Hello @TomG @MattiasM 

In this survey I activated the “Autoadvance on Questions and pages” in Motion in Look and feel, which enables a back button do you guys know if I can use any JavaScript to hide the back button I don’t want respondents to be able to go back. 

 

Thanks for your help. 

 

Userlevel 7
Badge +27
Qualtrics.SurveyEngine.addOnReady(function() {
this.disablePreviousButton();
this.hidePreviousButton();
});

 

Userlevel 3
Badge +3

Many thanks @TomG !

 

Do you know where should I insert this JavaScript ? 

Userlevel 7
Badge +27

If you want it to apply to the entire survey, add it the the survey header inside a <script> tag.

Userlevel 3
Badge +3

Hello @TomG 

You mean here ? 

 

Userlevel 7
Badge +27

Yes

Userlevel 3
Badge +3

Ok @TomG 

Thank you so much for your help !

Userlevel 3
Badge +3

Hello @TomG 

In my survey I have many “In page” display logic (see below) and I have this message in red saying “In Page display Logic may behave unexpectedly with validation option” but when I test the survey I don’t see nothing wrong, would ou advice to pay attention to this message anyway ? 

 

Userlevel 7
Badge +27

If it works correctly, you can ignore the warning.

Userlevel 3
Badge +3

Hi @TomG it’s me again ahah

I have a question on my questions that have “In page” display logic I have a CTA (Call To Action) button that appears but I don’t know why do you know maybe why  I have this (see below) : 

 

 

Userlevel 7
Badge +27

No, I don’t.

Userlevel 3
Badge +3
Qualtrics.SurveyEngine.addOnReady(function() {
this.disablePreviousButton();
this.hidePreviousButton();
});

 

Hello @TomG 

I tried this JavaScript and add the <script> at the begginning and and of the Javascript but unfortunately it doesn’t hide or disable the back button. Do you know why please ? 

Userlevel 6
Badge +39

Add it like this, and be sure to be in “source” mode.

As for why your “Terminé” button appears, it’s linked to your auto-advance options (combined with inpage display logic). Try checking the “hide” auto-advance button :

 

Userlevel 3
Badge +3

Hello @vgayraud 

Many thanks for your answer, I’ll try this :)

Userlevel 3
Badge +3

@vgayraud I have stars rating questions in my survey and because of my background image I feel like we don’t see the stars really well, do you know by any chance how I can highlighted them or put square around them ? 

 

Userlevel 7
Badge +27

@Tata C,

‘this’ refers to the current question object and isn’t set when the script is run from the header. You can use jQuery(“#PreviousButton”).hide(); instead.

Leave a Reply