How to remove radio buttons but keep text entry within multiple choice question | XM Community
Skip to main content
Solved

How to remove radio buttons but keep text entry within multiple choice question

  • September 13, 2023
  • 5 replies
  • 682 views

Forum|alt.badge.img+1

I need to remove the radio buttons from next to a text-entry enabled multiple choice question while keeping the last radio button with the “don’t know / unsure option.”  Not sure if I need javascript or html...

 

Best answer by Abhishek_U

@Steve_1987: you can use JavaScript to achieve this. 

add a unique ID or class to the last radio button “Don’t Know”. You can add an ID in last radio button using below code:

 

<label for="custom-radio">Don't know</label>
<input type="radio" id="custom-radio" name="your-question-name" value="don't know">

 

Now in “Look & Feel” section of survey, in “Custom JavaScript section”, you can add JavaScript code to hide radio buttons.

refer below code for your reference:

 

Qualtrics.SurveyEngine.addOnload(function() {
   // Hide all radio buttons except the last one (Don't know)
   jQuery('.q-radio:not(:last)').hide();
});

View original

5 replies

Abhishek_U
Forum|alt.badge.img+2
  • 9 replies
  • Answer
  • September 13, 2023

@Steve_1987: you can use JavaScript to achieve this. 

add a unique ID or class to the last radio button “Don’t Know”. You can add an ID in last radio button using below code:

 

<label for="custom-radio">Don't know</label>
<input type="radio" id="custom-radio" name="your-question-name" value="don't know">

 

Now in “Look & Feel” section of survey, in “Custom JavaScript section”, you can add JavaScript code to hide radio buttons.

refer below code for your reference:

 

Qualtrics.SurveyEngine.addOnload(function() {
   // Hide all radio buttons except the last one (Don't know)
   jQuery('.q-radio:not(:last)').hide();
});


Forum|alt.badge.img+1
  • Author
  • 3 replies
  • September 13, 2023

Thanks @Abhishek_U - where do I put the code:

<label for="custom-radio">Don't know</label>
<input type="radio" id="custom-radio" name="your-question-name" value="don't know">

 

In the CSS as well? In the Javascript on the question?


Abhishek_U
Forum|alt.badge.img+2

Put the code In HTML editor and next code in Custom JavaScript section.


Forum|alt.badge.img+1
  • Author
  • 3 replies
  • September 13, 2023

That gives me this:

 


Nam Nguyen
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+29
  • QPN Level 8 ●●●●●●●●
  • 1091 replies
  • September 13, 2023

@Steve_1987 I guess youre using simple layout
I can’t find the radio button under any specific id so can’t hide it individually. I can only hide all of them with this custom CSS code

.question .radio-button {
   display: none !important;
  }

You can still choose I don’t know by clicking on the text
 


Leave a Reply