Welcome to the LimeSurvey Community Forum

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

Refer to numerical input in 'Other' option to radio list

  • FranzGerbig
  • FranzGerbig's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 9 months ago #138320 by FranzGerbig
Hi folks,

how may one refer to the number typed into the 'Other' input box added to a radio list?
e.g.
Have moved to another town since the last interview?
No,
Yes, once
Yes, several times: _ _

Later questions and sub-questions I need to filter depending on the number put in before ...

Some idea?

using LS 3.13.2+180709
The topic has been locked.
More
7 years 9 months ago #138322 by steve_81
Hi,
if I understand correctly you can refer to this input with:
Code:
{Q1_other}
The following user(s) said Thank You: FranzGerbig
The topic has been locked.
  • FranzGerbig
  • FranzGerbig's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 9 months ago #138327 by FranzGerbig
Yes, you do :)
Thx a lot Steve!

works fine
# Name Relevance
SQ-2 online053_2 online052_other > 1

using LS 3.13.2+180709
The topic has been locked.
  • FranzGerbig
  • FranzGerbig's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 9 months ago #138331 by FranzGerbig
... and is there a way to define a maximum for that input?

using LS 3.13.2+180709
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 9 months ago - 7 years 9 months ago #138333 by tpartner
There is no question validation equation for list-radio questions. I think the easiest solution would be to have a separate numeric question for the "Other" amount, displayed with relevance. Then you can place a "Maximum value" value on it.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 7 years 9 months ago by tpartner.
The following user(s) said Thank You: FranzGerbig
The topic has been locked.
  • FranzGerbig
  • FranzGerbig's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 9 months ago #138334 by FranzGerbig
I hoped to be able to avoid this (default) way around :(

using LS 3.13.2+180709
The topic has been locked.
More
7 years 9 months ago - 7 years 9 months ago #138338 by steve_81
You may use a workaround with a hidden numeric question. It is not as comfortable as with the default input with other, but maybe it is good enough.

1) add a new question directly after the option list question
2) question type for this new question is numerical input. There you can define a maximum.
3) in the option list question:
a) option 'other' -> off
b) add this code to the questiontext (with click on Source):
Code:
<script type="text/javascript" charset="utf-8">  
$(document).ready(function() {
 
    // Identify the questions
    var q1 = $('#question'+{QID}+'');
    var q2 = $(q1).nextAll('.numeric:eq(0)');
 
    // Hide the numeric question
    $(q2).hide();
 
    // Move the hidden numeric input into the option list
     $('.label-text:last', q1).append($('input', q2));
 
    // Some styling...
    $('input', q1).css({
      'width': '20%',
    });
        });
</script>
c) in the 'edit answer options' add your text in the third option ("Yes, several times:")



Should work with 2.50 and at least the default template.

Edit: I guess you have to mention in the question text or anywhere else, that there is a maximum for the input.
Attachments:
Last edit: 7 years 9 months ago by steve_81.
The following user(s) said Thank You: FranzGerbig
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 9 months ago #138344 by DenisChenu

tpartner wrote: There is no question validation equation for list-radio questions.....

Vote , vite ;)
bugs.limesurvey.org/view.php?id=8941

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • FranzGerbig
  • FranzGerbig's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 9 months ago #138346 by FranzGerbig
great, but only works with both questions on the same page (not with question by question-format of the survey) :unsure: , right?

using LS 3.13.2+180709
The topic has been locked.
More
7 years 9 months ago #138347 by steve_81
I think you are right.
Due to the design, yes. I never use question by question, sorry.
The following user(s) said Thank You: FranzGerbig
The topic has been locked.
  • FranzGerbig
  • FranzGerbig's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 8 months ago #139081 by FranzGerbig
Sorry, I need to go back again:

May it be a condition/part of relevance equation that a respondent selects the _other option but doesn´t enter any number into the field? Like ...
q1_other == "Y"
or sth like that? As I'd know, he/she did it several times (just not how many times) the case would still be valid/useful for some of the following questions.
Put clear? :huh:

using LS 3.13.2+180709
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose