Hide the choice and have stars all the way to left | Experience Community
Skip to main content
Question

Hide the choice and have stars all the way to left

  • Dec 11, 2023 11:02 AM UTC
  • 20 replies
  • 331 views

Forum|alt.badge.img+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

MattiasM
Level 5 ●●●●●
Forum|alt.badge.img+63
  • Level 5 ●●●●●
  • Dec 11, 2023 12:28 PM UTC

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

 


Forum|alt.badge.img+3
  • Author
  • Level 3 ●●●
  • Dec 11, 2023 1:23 PM UTC

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);
});
});

 


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Dec 11, 2023 4:28 PM UTC

@Tata C,

Use this instead:

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

 


Forum|alt.badge.img+3
  • Author
  • Level 3 ●●●
  • Dec 11, 2023 5:29 PM UTC

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


Forum|alt.badge.img+3
  • Author
  • Level 3 ●●●
  • Dec 12, 2023 11:40 AM UTC

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. 

 


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Dec 12, 2023 11:52 AM UTC
Qualtrics.SurveyEngine.addOnReady(function() {
this.disablePreviousButton();
this.hidePreviousButton();
});

 


Forum|alt.badge.img+3
  • Author
  • Level 3 ●●●
  • Dec 12, 2023 12:59 PM UTC

Many thanks @TomG !

 

Do you know where should I insert this JavaScript ? 


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Dec 12, 2023 1:12 PM UTC

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


Forum|alt.badge.img+3
  • Author
  • Level 3 ●●●
  • Dec 12, 2023 1:14 PM UTC

Hello @TomG 

You mean here ? 

 


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Dec 12, 2023 1:41 PM UTC

Yes


Forum|alt.badge.img+3
  • Author
  • Level 3 ●●●
  • Dec 12, 2023 1:56 PM UTC

Ok @TomG 

Thank you so much for your help !


Forum|alt.badge.img+3
  • Author
  • Level 3 ●●●
  • Dec 12, 2023 3:05 PM UTC

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 ? 

 


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Dec 12, 2023 3:52 PM UTC

If it works correctly, you can ignore the warning.


Forum|alt.badge.img+3
  • Author
  • Level 3 ●●●
  • Dec 12, 2023 4:54 PM UTC

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) : 

 

 


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Dec 12, 2023 7:05 PM UTC

No, I don’t.


Forum|alt.badge.img+3
  • Author
  • Level 3 ●●●
  • Dec 13, 2023 6:03 AM UTC
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 ? 


vgayraud
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+68
  • QPN Level 8 ●●●●●●●●
  • Dec 13, 2023 7:59 AM UTC

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 :

 


Forum|alt.badge.img+3
  • Author
  • Level 3 ●●●
  • Dec 13, 2023 9:07 AM UTC

Hello @vgayraud 

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


Forum|alt.badge.img+3
  • Author
  • Level 3 ●●●
  • Dec 13, 2023 9:18 AM UTC

@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 ? 

 


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Dec 13, 2023 2:20 PM UTC

@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.