I'm designing a survey with 20 text entry questions in a randomizer. I would like to hide the next botton until participants type something in the text bar. I used theh following code:
Qualtrics.SurveyEngine.addOnReady(function () {
$('PreviousButton').hide();
if(jQuery(".ValidationError").text() == ""){
jQuery("#PreviousButton").hide();
} else {
jQuery("#PreviousButton").css("visibility","collapse");
}
var that = this.questionId;
jQuery("#NextButton").hide();
jQuery("[id='QR~"+that+"']").keyup(function(){
if(jQuery(this).val() != ''){
jQuery("#NextButton").show();
} else {
jQuery("#NextButton").hide();
}
});
});
Can anyone help me with this problem?
I am very new to Qualtrics, so please explain the solution (if there is any) more explicitly. Thank you all.
My goal was to prevent participants from hearing audios multiple times.
I tried to disable the play button by hiding the audio player after one. However, if the validation (I forced them to answer all questions) fails, which means participants click the next button without inputting a word, the player appears again. So I have to hide the next button until they type in the answer.
Another option would be to disable/hide the play botton of audio player after one click regardless of the state of validation.
Can someone help me to fix one of the two problems above? Thank in advance.