Turn off wrapping and/or widen text area on slider/star questions | XM Community
Solved

Turn off wrapping and/or widen text area on slider/star questions


Userlevel 1
Badge +2
Does anyone know of some javascript that will either widen the text area or turn off wrapping for statements on slider/star question types? On that note, I'm somewhat of a newbie at custom coding, I'd also really appreciate some instruction on where to put the code in the "edit question javascript" box. 😀 Thanks!
icon

Best answer by w.patrick.gale 18 June 2018, 16:50

View original

10 replies

Userlevel 5
Badge +13
The wrapping thing should be resolved using CSS. Simply add some CSS to your survey to overwrite the default CSS for the slider element you want to prevent from wrapping.

As for the custom coding, click the link to 'JS Question API' under the 'Edit question javascript' box to see some sample code using the API.
Userlevel 1
Badge +2
Thanks, but I think I need a little more hand-holding. Could someone help me with specific code I need? I have experience coding sql, but this is different. Also, do this code need to go in the CSS Editor under the Look & Feel menu? Or still in the "edit question JS" box for that specific question?
Userlevel 5
Badge +13
> @Julie_130 said: I need a little more hand-holding

Post an example of what is wrapping that you do not want to wrap. The CSS would go under the Look and Feel / Advanced / Add Custom CSS.

Depending on what you need it might simply look like:
.Slider th.ylabel{ white-space: nowrap !important; }
Userlevel 1
Badge +2
!
Userlevel 1
Badge +2
Not sure if you can see that picture (it's stripped on my browser). Ideally, the text would be right-aligned and allow for a longer string of text on one line. Word wrapping is fine , if it makes sense. But the current format only allows 2-3 words on each line.
Userlevel 5
Badge +13
@Julie_130 Yeah I see what you mean. Add this to you CSS in the Look and Feel:
.Slider th.ylabel{ white-space: nowrap !important; }
Userlevel 1
Badge +2
Thanks Patrick! I actually added this code a few days ago and it worked great! The only caveat is sometimes I want the text to wrap into a second line. Is there a way to keep the wrap on, but widen the text area?
Userlevel 5
Badge +13
Insert a html break tag <br/> if you want to force a break. In most cases there is a separator 'bar' between the labels and the responses you can click and drag left or right to change the label space.
Userlevel 1
Badge +2
That worked. Thank you for your help!
Userlevel 1
Badge +2

https://community.qualtrics.com/XMcommunity/discussion/comment/3139#Comment_3139Hello, do you have the code for this? I am in need of the same thing :)

Leave a Reply