- Posts: 44
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How to make one column in an array text question "readonly"?
- SherriChen
- Topic Author
- Offline
- Senior Member
Less
More
4 years 9 months ago #185858
by SherriChen
How to make one column in an array text question "readonly"? was created by SherriChen
Hi,
I need an array question which contains 3 columns:
Column 1-"Food items"
Column 2- "Measure unit"
Column 3- "Amounts per week"
I want to prefill something in Column 2 and make this column read-only, so that respondents cannot change it.
Is it possible to achieve it in LS 3.x?
Thank you for your help!
I need an array question which contains 3 columns:
Column 1-"Food items"
Column 2- "Measure unit"
Column 3- "Amounts per week"
I want to prefill something in Column 2 and make this column read-only, so that respondents cannot change it.
Is it possible to achieve it in LS 3.x?
Thank you for your help!
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12790
- Thank you received: 3940
4 years 9 months ago - 4 years 9 months ago #185863
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic How to make one column in an array text question "readonly"?
Hi,
here you find a working example survey how to disable the input fields.
www.limesurvey.org/forum/can-i-do-this-w...-matrix-cells#185706
Best regards
Joffm
here you find a working example survey how to disable the input fields.
www.limesurvey.org/forum/can-i-do-this-w...-matrix-cells#185706
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 9 months ago by Joffm.
The topic has been locked.
- SherriChen
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 44
- Thank you received: 0
4 years 9 months ago #185866
by SherriChen
Replied by SherriChen on topic How to make one column in an array text question "readonly"?
Thank you, Joffm! It works perfectly!
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
4 years 9 months ago #185887
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic How to make one column in an array text question "readonly"?
Be careful with disabling inputs - this will prevent their value being recorded in the data. You can use .prop('readonly', true) instead.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu, Joffm
The topic has been locked.
- SherriChen
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 44
- Thank you received: 0
4 years 9 months ago #185893
by SherriChen
Replied by SherriChen on topic How to make one column in an array text question "readonly"?
Thank you, tpartner! It works great!
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12790
- Thank you received: 3940
4 years 9 months ago #185899
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic How to make one column in an array text question "readonly"?
Yes, an important remark of tpartner.
You see, it was not my script. The TE provided it in his question.
Joffm
You see, it was not my script. The TE provided it in his question.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- SherriChen
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 44
- Thank you received: 0
4 years 9 months ago #185901
by SherriChen
Replied by SherriChen on topic How to make one column in an array text question "readonly"?
Hi Joffm,
Your script also works and it helps me solve another problem about inserting different select options into different cells. I just update your script with Tpartner's suggestions. Whatever, thank you very much for your help!
Your script also works and it helps me solve another problem about inserting different select options into different cells. I just update your script with Tpartner's suggestions. Whatever, thank you very much for your help!
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12790
- Thank you received: 3940
4 years 9 months ago #185903
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic How to make one column in an array text question "readonly"?
Yes, therefore I sent the whole survey.
Because there are other interesting things to learn included.
And I informed the TE of the other thread about Tony's suggestion.
Best wishes to Eindhoven
Joffm
Because there are other interesting things to learn included.
And I informed the TE of the other thread about Tony's suggestion.
Best wishes to Eindhoven
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- SherriChen
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 44
- Thank you received: 0
4 years 9 months ago #185910
by SherriChen
Replied by SherriChen on topic How to make one column in an array text question "readonly"?
Sorry, I come again. I meet a similar problem in another array text question.
Please see the picture below, I want to make cells in Column 3 read-only only if people choose "3" in Column 2. Is it possible to do this?
Please see the picture below, I want to make cells in Column 3 read-only only if people choose "3" in Column 2. Is it possible to do this?
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
4 years 9 months ago #185911
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic How to make one column in an array text question "readonly"?
Do you also want to delete any value in column-3 if 3 is selected in column-2?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- SherriChen
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 44
- Thank you received: 0
4 years 9 months ago #185912
by SherriChen
Replied by SherriChen on topic How to make one column in an array text question "readonly"?
No. If people choose "1" or "2", they need to answer question in Column-3. If they choose "3", the column-3 in this row will turn grey and people don't need to answer it.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12790
- Thank you received: 3940
4 years 9 months ago #185914
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic How to make one column in an array text question "readonly"?
Hi,
just something to consider:
IMO you are sticking to some preconceived ideas regarding the design of your survey without having done some prototyping to see what is possible out of the box and what is not.
Sometimes I think the students asking questions here saw an illustration in a book and now the look and feel of their question has to be exactly like that.
Generally: More simple questions are always better than many different things in one array.
For example here:
You can solve this very easily by splitting the question.
If the question of column 3 is a separate question, you can use relevance equation to display or not according to the answer in column 2 (without any javascript "tricks").
Just to give you an idea
Joffm
just something to consider:
IMO you are sticking to some preconceived ideas regarding the design of your survey without having done some prototyping to see what is possible out of the box and what is not.
Sometimes I think the students asking questions here saw an illustration in a book and now the look and feel of their question has to be exactly like that.
Generally: More simple questions are always better than many different things in one array.
For example here:
You can solve this very easily by splitting the question.
If the question of column 3 is a separate question, you can use relevance equation to display or not according to the answer in column 2 (without any javascript "tricks").
Just to give you an idea
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.