default choices - how to unable editing this for repondent | XM Community
Skip to main content
Hi,

I'm using default choices to store some calculations based on the answers given by respondent in previous questions (to build more complex validation inside questionnaire) and I was wondering, maybe somebody has already managed how to make those fields with default choices uneditable?
For sure! Is the field type a Text Entry Field?



If so, in the JS API you can use JQuery to set the field to readonly. I'm not sure if you're technical - if not, I can totally walk you through it!



But if you get the ID of the Field (similar to `#QR~QID1`) and reference it through JQuery and then run this function: `.prop("readonly", true);`
There may be a way to do it in the Qualtrics Platform, but I haven't seen it yet.
Thank you Michael! Yes, this is about text entry field. I've never used JS API before, but I'll try too.

One more thing, because I saw that this default choice (containing calculations based on input form previous question) is not updating after respondent make changes to the previous questions. I used page breaks, so questions are separated, but still it's not updating. Any ideas how to solve this?
Hmm... I'm not quite sure - If it's in a separate block, it _might_ be in a separate scope. This, I'm really unsure about, but if that's the case, what if, after there was a change to the data, update the Embedded Data Fields, and then pull from that in the next block?



Here is the code for getting and setting Embedded Data Fields:



`Qualtrics.SurveyEngine.setEmbeddedData('FIELD', value);`

`Qualtrics.SurveyEngine.getEmbeddedData('FIELD');`



And then you can pipe that information into that text entry field. Would it be easier to just assign the total to a Text Description in a question or block? I'm just trying to find the easiest way for you.

Hi @Michael_Campbell_RedPepper ,

 

I am trying to implement this on my side-by-side question, where I want all text pre-populated in one column (the second column- see below) to be non-editable. I am trying the following JS code (the question ID is 79), to no avail.

jQuery("y#QR~QID79]").attr("readonly",true);

 

Any suggestions?

 

Thanks!!

 

 


Leave a Reply