Welcome, Guest
Username: Password: Remember me

TOPIC: Filter a multi response but keep 2 last option visible

Filter a multi response but keep 2 last option visible 2 years 8 months ago #78178

  • fredieby
  • fredieby's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 10
  • Thank you received: 1
  • Karma: 0
Hi,

I have Q1 which is a multi quest, I want to filter Q2 which is also a multi quest with Q1 but would like that the 2 last options stay visible.

Can I have any help pls

Cheers,
Fred
The administrator has disabled public write access.

Re: Filter a multi response but keep 2 last option visible 2 years 8 months ago #78181

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4410
  • Thank you received: 842
  • Karma: 385
Are the questions on separate pages?
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: fredieby

Re: Filter a multi response but keep 2 last option visible 2 years 8 months ago #78182

  • fredieby
  • fredieby's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 10
  • Thank you received: 1
  • Karma: 0
Hi Tony,

Yes they are on seperate page

Cheers,
Fred
The administrator has disabled public write access.

Re: Filter a multi response but keep 2 last option visible 2 years 8 months ago #78187

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4410
  • Thank you received: 842
  • Karma: 385
1) Set up your survey to use JavaScript.

2) Add the following script to the source of second question. Replace "QQ" with the second question question ID.
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
		var qID = QQ;
 
		var rows = $('#question'+qID+' li[id^="javatbd"]').length;
 
		setTimeout(function() { 
			$('#question'+qID+' li[id^="javatbd"]').each(function(i){
				if(i >= rows-2) {
					$(this).show();
				}
			});
		}, 200);			
	});
 
</script>
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.
Last Edit: 2 years 8 months ago by tpartner.
The administrator has disabled public write access.
The following user(s) said Thank You: fredieby

Re: Filter a multi response but keep 2 last option visible 2 years 8 months ago #78243

  • fredieby
  • fredieby's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 10
  • Thank you received: 1
  • Karma: 0
:woohoo: Great Tony!

Thank you very much!!!

Cheers,
Fred
The administrator has disabled public write access.

Re: Filter a multi response but keep 2 last option visible 2 years 8 months ago #78245

  • fredieby
  • fredieby's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 10
  • Thank you received: 1
  • Karma: 0
Hi again Tony,

Im having a problem with the script, when I click on previous it erase the answer in the last 2 option :(

Cheers,
Fred
The administrator has disabled public write access.

Re: Filter a multi response but keep 2 last option visible 2 years 8 months ago #78402

  • fredieby
  • fredieby's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 10
  • Thank you received: 1
  • Karma: 0
Hello,

Any help on this issue?

Cheers,
Fred
The administrator has disabled public write access.

Re: Filter a multi response but keep 2 last option visible 2 years 8 months ago #78669

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5501
  • Thank you received: 312
  • Karma: 253
fredieby wrote:
Hello,

Any help on this issue?

Cheers,
Fred
Tony does all this valuable help in his free time. He offers advanced (paid) support though. Try to contact him by forum PM if necessary.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.123 seconds
Donation Image