Welcome, Guest
Username: Password: Remember me

TOPIC: Multiple choice array with a "none of these" exclusion?

Multiple choice array with a "none of these" exclusion? 2 months 2 weeks ago #111407

  • markswarm
  • markswarm's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 1
  • Karma: 0
Hi all, is it at all possible to create a multiple choice array, where if you select "none of these" it excludes anything else within that column?

Been trying to crack this for a while now!
The administrator has disabled public write access.

Multiple choice array with a "none of these" exclusion? 2 months 2 weeks ago #111418

  • Bigred
  • Bigred's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 29
  • Thank you received: 10
  • Karma: 2
You can use javascript to do this.

Trigger some script on click of your exclusive option that disables all of the inputs in that column.

Each column td will have a class of 'answer_cell_001', 'answer_cell_002', answer_cell_003.. ect. If someone clicks the exclusive for all answer_cell_001's, just do something like "$('.answer_cell_001').children('input').attr('disabled, true);" and all of the inputs in that column should get disabled. Any input with a status of disabled is ignored when the form is submitted so you wont have to worry about wiping the data for these inputs.

You will have to check to see if the exclusive input is being checked or unchecked though to disable or enable as needed (People should be able to change their mind and without it, all of the inputs would remain disabled).

Now to make it work with the smallest amount of code you will want to set it to trigger on click of any answer option in the exclusive row, find out what 'answer_cell_XXX' it belongs to and apply the code to all inputs minus the exclusive whos parents also have the same 'answer_cell_XXX' class.

A quick warning. If you select an option on this question type then uncheck it, it leaves a value of 0 in the input so the limesurvey exclusive option has a hole that people can get through. I always work my own check in when the #movenextbtn is clicked then throw up an alert and return false top stop the page if nothing is checked.

(Another way that I haven't gotten around to trying is using multiple choice questions for each column then floating them left so they line up side by side. This way would allow you to use the limesurvey exclusive and mandatory options and will be purely css)

This is how I have been adding exclusive options, hope this gets you helps you with your issue.
The administrator has disabled public write access.

Multiple choice array with a "none of these" exclusion? 2 months 2 weeks ago #111438

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4280
  • Thank you received: 807
  • Karma: 370
Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Multiple choice array with a "none of these" exclusion? 2 months 2 weeks ago #111450

  • Bigred
  • Bigred's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 29
  • Thank you received: 10
  • Karma: 2
A quick warning. If you select an option on this question type then uncheck it, it leaves a value of 0 in the input so the limesurvey exclusive option has a hole that people can get through. I always work my own check in when the #movenextbtn is clicked then throw up an alert and return false top stop the page if nothing is checked.

Sorry, the above is about the limesurvey mandatory and being able to get past these question types if you check then uncheck an option.
The administrator has disabled public write access.

Multiple choice array with a "none of these" exclusion? 3 weeks 1 day ago #112985

  • srocky
  • srocky's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
Hi all,

(first of all sorry in advance for my english)

I've tried to use a workaround solution of which tpartner mentioned above, but evidently I've messed up something. I don't know what may gone wrong in a copy/paste action, but when I've used this script the last option indeed exclude every previous options in a row, but while answering following subquestions, the previous exclusive checkboxes become unchecked (however database catch those options as checked). Moreover in the last row exclusive are the last two options.

If anybody can tell me what am I doing wrong?

Best regards for all.
The administrator has disabled public write access.

Multiple choice array with a "none of these" exclusion? 3 weeks 1 day ago #112986

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4280
  • Thank you received: 807
  • Karma: 370
What LS version?

What template?


.
Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Multiple choice array with a "none of these" exclusion? 3 weeks 1 day ago #112987

  • srocky
  • srocky's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
LimeSurvey version: 2.05+ Build 140320
Template: basic (with some graphical changes).

Meybe the fact that I'm using XAMPP (not physical server) may have significance?

Thanks in advance for help.
The administrator has disabled public write access.

Multiple choice array with a "none of these" exclusion? 3 weeks 1 day ago #112989

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4280
  • Thank you received: 807
  • Karma: 370
I have updated the workaround to work with that template - manual.limesurvey.org/Workarounds:_Manip..._Excludes_All_Others


.
Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: srocky

Multiple choice array with a "none of these" exclusion? 3 weeks 1 day ago #112990

  • srocky
  • srocky's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
:woohoo: It works!

Thank you a lot!
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.146 seconds
Donation Image