multiple choice -> text entry (hidden) | XM Community
Skip to main content
How to achieve the beginning of the text entry is hidden, the text entry appears when the other option is selected,like this.

!!

thanks a lot.
Hi @Cathaya,



Use the below code to achieve this. Place the script in Qualtrics.SurveyEngine.addOnReady()



jQuery('input:text').hide();



var rid =jQuery("input[type='text']").parent().parent().find("input[type='radio']").attr("id");



jQuery("[type='radio']").change(function()

{



if(jQuery("[id='"+rid+"']").prop("checked") == true)

{

jQuery("[id*='"+rid+"~TEXT']").show();

}

else

{

jQuery("[id='"+rid+"~TEXT']").val('');

jQuery("[id='"+rid+"~TEXT']").hide();

}



});
@Alfia, I would also love to do this, but the code doesn't appear to be doing anything when placed into the AddOnReady section. Any ideas how to fix it?



EDIT: It worked under the "OnLoad"
> @uhrxx005 said:

> @Alfia, I would also love to do this, but the code doesn't appear to be doing anything when placed into the AddOnReady section. Any ideas how to fix it?



Thanks, I've updated the code, please check..
What changed? I actually got it working fine when I moved it to the OnLoad instead of OnReady section
Hi! This helped me, but only works with the small sized text entry. How can it work with a medium size text entry too?

Leave a Reply