Need to make the 2 columns as read only in matrix table. | XM Community
Skip to main content

Im able to make the first row second column as read only. But couldn't make the last cell in the second row. Update me how to code for the specific cells.
Screenshot 2023-02-06 155325.jpg

Just find the class and add a class as .prop('disabled',true);
Like, jQuery('input[type="text"]').eq(5).prop('disabled',true);


https://community.qualtrics.com/XMcommunity/discussion/comment/55109#Comment_55109This is the code I used to disable the first row last column cell.
jQuery('#'+this.questionId+' tbody tr:first td:last').find('input[type="text"]').attr('readonly','readonly')  
Kindly update me with the similar code to disable the last cells in each columns.


Hi jbk ,
you can achieve the same assuming structure remains same using below code which shoul be added into Qualtrics API :
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/

});

Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
let text=document.querySelectorAll("input[type=text]")
for(let i=0;i{  

  textt1].readOnly=true;
  texttext.length-1].readOnly=true;
   
   
}
});

Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/

});

Hope it resolves your query😊!!



jbk Here is the solution,
jQuery('#'+this.questionId+' tbody tr:last td:last').find('input[type="text"]').attr('readonly','readonly') 
Alternatively, you can use eq instead and get the required textbox (going from left to right to downwards from 0) to set to readonly function.


Leave a Reply