Making a text entry field read-only | XM Community
Skip to main content
Hi,

I have a side-by-side table with 10 text entry boxes (in two columns of 5), and I have set default text for the first two rows. (These two rows serve as "examples".) I'd like to make those text entry boxes read-only, so that it looks like the other text entry boxes but they can't make changes to the text.



I've found a few different sets of instructions on how to do this, but none seem to work. Here is what I've tried:



Qualtrics.SurveyEngine.addOnReady(function()

{

document.getElementById("#QR~QID3#1~1~1~TEXT").readOnly = true;

jQuery("#QR~QID3#1~1~2~TEXT").attr('readonly',true);

jQuery("#QR~QID3#1~2~1~TEXT").prop("disabled", true);

jQuery("#QR~QID3#1~2~2~TEXT").setReadOnly(true);

});



Any advice would be helpful, including alternate strategies for achieving my objective.
Hello @emilym ,



Use the below code and change id as required:



`jQuery("[id='QR~QID3#1~1~1~TEXT']").attr("readonly",true);`

Leave a Reply