Remove label in multiple choice question and only allow number entry | XM Community
Solved

Remove label in multiple choice question and only allow number entry

  • 19 February 2021
  • 5 replies
  • 181 views

Badge +1

Hello,
I have a multiple-choice question with 3 answer options. The first one is supposed to be just a text entry box but a) only numbers should be allowed to enter, and b) there should not be anything else but the textbox (so, no label of the answer option). Basically, I want a text entry box with numbers only allowed, and then 2 options with "don't know" and "refuse to answer".
Hope this makes sense and someone can help me.
Thanks a lot!

icon

Best answer by ahmedA 19 February 2021, 21:41

View original

5 replies

Userlevel 7
Badge +21

Make the text of option a to:

...

You can use validation to allow only numbers.

Badge +1

https://www.qualtrics.com/community/discussion/comment/34751#Comment_34751Thanks for your answer but is there another way than just making the text transparent? It looks odd when taking the survey.
On the validation issue, it doesn't let me allow only numbers. In the custom validation option, it only lets me add an error message.

Userlevel 7
Badge +21

Change style to

"display:none"

Add this line to your JS:
this.getQuestionContainer().querySelector(".TextEntryBox").type = "Number";

Badge +1

Like this? ...
It still leaves this grey box above the text entry
Screen Shot 2021-02-19 at 15.18.00.png
Thanks, the JS code for the number validation worked!

Userlevel 7
Badge +21

Oh that! Let the text be anything. Add this to your JS:

this.getQuestionContainer().querySelector(".TextEntryBox").previousElementSibling.hide();

Leave a Reply