Prevent editing a text box in constant sum question type | XM Community
Question

Prevent editing a text box in constant sum question type


Userlevel 7
Badge +6
Hello all,

I want to create a constant sum question where the first entry is a value piped in from embedded data (pretty straightforward) BUT I don't want to allow the survey taker to edit this value, only the other text entry portions of the constant sum question.

Any ideas our there on how to do this?

4 replies

Hello @Akdashboard ,

Paste the below code in the js(OnReady) of constant sum question:

`jQuery("#"+this.questionId+" .InputText:first").attr("readonly",true);`
Userlevel 7
Badge +6
> @Shashi said:
> Hello @Akdashboard ,
>
> Paste the below code in the js(OnReady) of constant sum question:
>
> `jQuery("#"+this.questionId+" .InputText:first").attr("readonly",true);`

That didn't seem to work...

Please ignore the horrible formatting: https://bcbssc.az1.qualtrics.com/jfe/preview/SV_6zZ0LgfB46RW3LD/BL_3lPGcJYCIf8wMPr?Q_SurveyVersionID=current

!
Userlevel 7
Badge +6
I doubt this will matter, but it is a matrix question with Constant Sum selected.
Userlevel 7
Badge +6
I am giving this thread a little bump.

Anyone have any idea how to achieve this?

Leave a Reply