I am new to qualtrics and am creating a survey for a clinical research trial.
I have a multiple choice question with 3 choices. Only one answer is allowed. Each choice has text entry allowed. If a participant selects one answer and enters text in the box, then they change their mind and make another selection, how do I clear the text from the box they first selected and entered text into?
I really look forward to getting advice from you experts. I have spent hours googling this to no avail.
Clearing text from multiple choice questions if a person changes their mind on the selection
Best answer by PAZ
Thank you for your suggestions TomG and MattiasM
I got the following code from Rudi that works perfectly - thanks again Rudi.
*******the below code deletes the other texts of unselected choices*******
you need to adopt the QID to your needs and also the numbers in your condition and in the get elementById function
Qualtrics.SurveyEngine.addOnReady(function()
{
this.questionclick = function(event,element){
let selectedChoices = this.getSelectedChoices();
if(selectedChoices.include('1') === false){
document.getElementById("QR~QID4~1~TEXT").value=''
}
if(selectedChoices.include('2') === false){
document.getElementById("QR~QID4~2~TEXT").value=''
}
if(selectedChoices.include('3') === false){
document.getElementById("QR~QID4~3~TEXT").value=''
}
}
});
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
