Welcome to the LimeSurvey Community Forum

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

Autofill Multiple Question

  • SurveyDennis
  • SurveyDennis's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 1 month ago #152542 by SurveyDennis
Autofill Multiple Question was created by SurveyDennis
I would like to fill the answers given from one multiple choice question into another multiple choice question.
The first multi response question is called Q1
The second is called Q1DUM

I am trying to do this as following:

{ Q1DUM = if (Q1.NAOK == "SQ001", "SQ001")}

But this is not working, any idea?

Be SurveyFriendly too! Fight against boring surveys! www.SurveyFriendly.com
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 1 month ago #152550 by holch
Replied by holch on topic Autofill Multiple Question
I think there are few things wrong with your equation.

Where do you post this? In one of the answer options of the second questions, I assume?

Multiple choice questions work a little different than other questions. You need to check if Q1_SQ001 was marked Y I think.

I think this should work (not tested):
Code:
{if(Q1_SQ001 == "Y", "SQ001.shown",""}
"shown" is necessary to show the answer option, otherwise I think it will only show "Y", which is the answer to that subquestion. And you need the empty "" at the end, because you need something for the "else".

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
  • SurveyDennis
  • SurveyDennis's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 1 month ago #152557 by SurveyDennis
Replied by SurveyDennis on topic Autofill Multiple Question
Many thanks for your reply!

I have tried it but it didn't worked.
However I found a solution with JS.

Question 818 is my original Q1
Question 841 is the dummy question where I autopunch the answer.

<script type="text/javascript" charset="utf-8">
$(document).ready(function() {

$('#answer417528X205X818SQ001').click(function () {
$( '#answer417528X205X841SQ001' ).prop('checked', true);
});

});
</script>

Be SurveyFriendly too! Fight against boring surveys! www.SurveyFriendly.com
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 1 month ago #152576 by holch
Replied by holch on topic Autofill Multiple Question
Oh, are you trying to tick the answer in the second question, is that what you tried to do? I thought you wanted to show the text of the item in the second one.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
  • SurveyDennis
  • SurveyDennis's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 4 weeks ago #152621 by SurveyDennis
Replied by SurveyDennis on topic Autofill Multiple Question
Yes sorry, I tried two things.
For one follow up question to only show the answers selected.
And one dummy question to also tick the selected answers.

All working! I am make sure to document these examples and share them to the community.

Be SurveyFriendly too! Fight against boring surveys! www.SurveyFriendly.com
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose