Welcome to the LimeSurvey Community Forum

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

customized 'other' option

  • ziyaei_f
  • ziyaei_f's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 3 months ago #177570 by ziyaei_f
customized 'other' option was created by ziyaei_f
Hi to all,

for my project, I needed to customize my multiple choices answers. as you see in the attached picture, it's a kind of nested choices. when the user clicks on one of the two given options, a dropdown of another aspects appears. I had to also add two "other" options for each answer. I defined that by creating a checkbox and also a text box beside that, the textbox appears when the checkbox is checked.
everything works well, but I have problem with recording the responses. the text of created textbox is not saved.
Can enyone help me please?
Attachments:
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 3 months ago #177572 by holch
Replied by holch on topic customized 'other' option
Of course the text in the text box is not saved, because this text box has no connection what so ever to the LS database.

I think you will have to create a question with text boxes in Limesurvey and somehow move the text box of this question into the right position.

However, I have no idea how to do this.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: ziyaei_f
The topic has been locked.
  • ziyaei_f
  • ziyaei_f's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 3 months ago #177573 by ziyaei_f
Replied by ziyaei_f on topic customized 'other' option
Thanks. Is there any way to add two 'other' option to a multiple choice question?
with two 'other' fields, my problem will be solved.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 3 months ago #177574 by holch
Replied by holch on topic customized 'other' option
No, not that I know of. I would have told you so, if this would be an option.

But actually, I think you are over-complicating things to have it all in one question. In my opinion your approach are actually 3 different questions, because I assume that it can only either be worthy or not worthy and not both, correct? At the moment in your setup, someone can mark both.

Q1: is it worthy or not worthy?
Q2: Why is it worthy?
Q3: Whi is it not worthy?

Depending on the answer to Q1 (single choice) you could show Q2 or Q3 and then you can have easily an "other" option for both.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: ziyaei_f
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 3 months ago #177592 by tpartner
Replied by tpartner on topic customized 'other' option

Is there any way to add two 'other' option to a multiple choice question?

manual.limesurvey.org/Question_type_-_Mu...choice_with_comments . You will need to hide some inputs.

Also see manual.limesurvey.org/Workarounds:_Manip..._options.22_question

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • ziyaei_f
  • ziyaei_f's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 3 months ago #177599 by ziyaei_f
Replied by ziyaei_f on topic customized 'other' option
Thanks. the second link which you wrote, is exactly what I used to design my checkboxes. I used at first multiple choices without comment and then defined the 'other' option manually. But I faced with the problem of recording the responses. now, I am trying to change the question type to multiple choice with comment and then trying to hide input text of each choice except 'other' options. but the code which I use to hide doesn't work.
I tested different following code:
$('#question'+{QID}+' li[id^="javatbd"]:eq(0) .comment').hide();
$('#question'+{QID}+' input.text:eq(0)').hide();

I also tested that with remove() function instead hide(), but I am still having problem.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 3 months ago #177615 by tpartner
Replied by tpartner on topic customized 'other' option
Try this to remove the inputs:

Code:
<script type="text/javascript" charset="utf-8">
 
  $(document).on('ready pjax:scriptcomplete',function() {
 
    $('#question{QID} ul.answers-list li:eq(0) input:text').remove();
    $('#question{QID} ul.answers-list li:eq(1) input:text').remove();
  });
</script>



Sample survey attached:

File Attachment:

File Name: limesurvey...8723.lss
File Size:33 KB

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: ziyaei_f
The topic has been locked.
  • ziyaei_f
  • ziyaei_f's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 3 months ago #177662 by ziyaei_f
Replied by ziyaei_f on topic customized 'other' option
Thanke you so much Tony. that worked.
The topic has been locked.
  • ziyaei_f
  • ziyaei_f's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 3 months ago #177674 by ziyaei_f
Replied by ziyaei_f on topic customized 'other' option
Hi, Can you please explain me more how could I have such a design with Q1,Q2 and Q3. actually a combination of radio button and checkboxes?
I think that I should set a condition, but I have never used conditions.
Thanks
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 3 months ago #177678 by holch
Replied by holch on topic customized 'other' option
Pretty easy. You create 3 different questions.

Q1: Is it worth? (single response)
- 1. It is worthy.
- 2. It is not worthy.

Q2: Why do you think it is worthy? (multiple response)

Q3: Why do you think it is NOT worthy? (multiple response)

For Q2 you set the rellevance equation to Q1==1 and for Q3 you set the relevance equation to Q1==2.

So Q2 is only shown if the respondent marked 1 in Q1 and Q3 is only shown if marked 2 in Q1.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • ziyaei_f
  • ziyaei_f's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 3 months ago #177681 by ziyaei_f
Replied by ziyaei_f on topic customized 'other' option
Thanke you so much
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose