default choices - how to unable editing this for repondent | XM Community
Solved

default choices - how to unable editing this for repondent

  • 14 March 2018
  • 5 replies
  • 166 views

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?
icon

Best answer by Michael_Campbell_RedPepper 14 March 2018, 19:10

View original

5 replies

Userlevel 4
Badge +3
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);`
Userlevel 4
Badge +3
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?
Userlevel 4
Badge +3
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.
Userlevel 1
Badge +4

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("[#QR~QID79]").attr("readonly",true);

 

Any suggestions?

 

Thanks!!

 

 

Leave a Reply