Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Hide column in array question

More
3 years 4 months ago #231556 by tpartner
You didn't tell us what type of array so I'm going to assume an array-texts.

If you only want to hide the last column, I would do it with CSS rather than JS in the question source:

Code:
<style type="text/css" data-author="Tony Partner">
 
  #question{QID} .subquestion-list col:last-child,
  #question{QID} .subquestion-list th:last-child,
  #question{QID} .subquestion-list td:last-child {
    display: none !important;
  }
 
  #question{QID} .subquestion-list col {
    width: auto !important;
  }
</style>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
3 years 4 months ago - 3 years 4 months ago #231630 by IDEA_Rozwoju
Dear tpartner, thank you so much it works great (also for basic array - with radio buttons).
 
Last edit: 3 years 4 months ago by IDEA_Rozwoju.

Please Log in to join the conversation.

More
10 months 3 days ago #269656 by arnabbhuyan
Hi Tpartner,
the above script works perfectly to hide selected category to the next question. But if i want to use the same category in the next question (instead of hiding) what change will take place in the code..?

Thanks,

Please Log in to join the conversation.

More
10 months 2 days ago - 10 months 2 days ago #269663 by tpartner

Hi Tpartner,
the above script works perfectly to hide selected category to the next question. But if i want to use the same category in the next question (instead of hiding) what change will take place in the code..?

Thanks,
I am using a mobile device, so cannot test, but if you want to show the selected columns instead of hiding them, try changing this line:
Code:
if(filter == 'Y') {

To this:
Code:
if(filter != 'Y') {

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 10 months 2 days ago by tpartner.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose