Temporarily hide radio buttons - JS code not working in customized design | XM Community
Question

Temporarily hide radio buttons - JS code not working in customized design

  • 26 April 2019
  • 1 reply
  • 24 views

Badge +2
Hi,
I found in one of qualtrics' forums the following code in java script to help me temporarily hide the radio buttons until 10 seconds have passed (I marked the most relevant line):

Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#NextButton").hide(); jQuery("#tempHead").hide();
this.hideNextButton();
var that=this;
this.hideNextButton();
jQuery('input[type=radio]').hide();

setTimeout(
function(){
jQuery('input[type=radio]').show();
},
10000);

this.questionclick = function(event,element){
//for a single answer multiple choice question, the element type will be radio
if (element.type == 'radio')
{
that.showNextButton();
}
}
});


However, this code for some reason only works when I use it in a separate survey project, but not when I try to put it inside my project which has a certain design my lab partner built a while ago.

I think it is connected to the "look and feel" according to what I searched online, but I couldn't find exactly where I can define that in a certain block there will be an exception for the design which will allow for the radio buttons to appear only after 10 seconds.

Alternatively, maybe there is another place where I should change the settings so it could work also on the block inside the exiting survey with the special design and not only in a separate survey project?


Thanks,
Yarden

1 reply

Userlevel 5
Badge +6
Hi Yarden,
try to check your radio elements in inspector (see a nice text about it here). It is possible, that your element is NOT an `input` of type `radio`.
Also try to check this discussion about similar problem that I had.

Leave a Reply