- Posts: 28
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Hide next question by answering previous one
- Stan
- Topic Author
- Offline
- Junior Member
Less
More
7 years 8 months ago #138964
by Stan
Hide next question by answering previous one was created by Stan
Hi, i would like to simply hide a question Q2 when the direct previous question Q1 (multiple choice) is answered through Checkbox (click).
I tried some EM and Javascript without success and may Need some help.
Using Version 2.50+ Build160606
This is what i've tried
I tried some EM and Javascript without success and may Need some help.
Using Version 2.50+ Build160606
This is what i've tried
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Identify the questions var this = $('#Q1{ID}'); var nextQuestion = $(thisQuestion).next('div[id^="question"]'); if ($(this).is(':checked')) { $(this).(nextQuestion).hide(); } else{ $(this).(nextQuestion).show(); } }); </script>
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3691
7 years 8 months ago #138965
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Hide next question by answering previous one
You should be able to use Expression manager relevance like this:
Sample survey attached:
Code:
Q1_SQ001 != 'Y'
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The following user(s) said Thank You: Stan
The topic has been locked.
- Stan
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 28
- Thank you received: 0
7 years 8 months ago #138966
by Stan
Replied by Stan on topic Hide next question by answering previous one
Thank you!
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13910
- Thank you received: 2548
7 years 8 months ago #138983
by DenisChenu
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.
Replied by DenisChenu on topic Hide next question by answering previous one
Hi,
Just one question:
Where do you find this ?
#question{Q1.qid} or #answer{Q1.sgq} why not, but where did you found #Q1{ID} ????
Just one question:
Code:
// Identify the questions var this = $('#Q1{ID}');
#question{Q1.qid} or #answer{Q1.sgq} why not, but where did you found #Q1{ID} ????
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.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3691
7 years 8 months ago #138989
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Hide next question by answering previous one
I didn't address any JavaScript issues because it's not required.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13910
- Thank you received: 2548
7 years 8 months ago #138990
by DenisChenu
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.
Replied by DenisChenu on topic Hide next question by answering previous one
Yes, and your solution is really better .
But i want to know where Stan found this instructions . Maybe some error in manual
But i want to know where Stan found this instructions . Maybe some error in manual
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.
- Stan
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 28
- Thank you received: 0
7 years 8 months ago #139276
by Stan
Replied by Stan on topic Hide next question by answering previous one
Hi, this has nothing to do with the Manual. i just tried to fix the issue by writing my own Javascript code. Then i posted it here, so that someone could eventually show me what is wrong with that code (so thanks for your corrections), or propose a better way like tpartner did.DenisChenu wrote: But i want to know where Stan found this instructions . Maybe some error in manual
The topic has been locked.