Lock value in rows | XM Community
Skip to main content

Lock value in rows

  • January 31, 2023
  • 5 replies
  • 26 views

Nikkki
Level 5 ●●●●●
Forum|alt.badge.img+17

Hello All I have two questions and i want to show value entered in one question in another question and want to fix that value so that respondent cannot edit it again. Although i am aware of the default choice functionality but still i am able to edit it is there a way to fix the values and lock the cell in second question.
image.pngimage.png

5 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • January 31, 2023

You can use JavaScript to make the inputs in the second question read only.


dipeshsingh
Level 2 ●●
Forum|alt.badge.img+12
  • Level 2 ●●
  • January 31, 2023

Nikkki
Use belo code:

document.getElementById('ID').setAttribute('readonly', true);

You just need to add ispect element of your filled input box and find it's ID. Pass that ID in above code.



TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • January 31, 2023

https://community.qualtrics.com/XMcommunity/discussion/comment/54856#Comment_54856It is better not to hard code ids. Use the power of jQuery to do it in one line without having to find ids. If you want to update the inputs in the first column, you can do:
jQuery("#"+this.questionId+" .SBS1 input").prop("readonly",true);


dipeshsingh
Level 2 ●●
Forum|alt.badge.img+12
  • Level 2 ●●
  • January 31, 2023

https://community.qualtrics.com/XMcommunity/discussion/comment/54859#Comment_54859Thanks TomG. I am not good with JS or javascript so I will definetly look into your advise ;)


Nikkki
Level 5 ●●●●●
Forum|alt.badge.img+17
  • Author
  • Level 5 ●●●●●
  • February 2, 2023

TomG and dipeshsingh I was able to make the area unclickable so that values cannot be changed.
Thank you for the suggestions.