Check out the LimeSurvey source code on GitHub!

Filter "multiple short text" question with answers from previous multiple-choice

More
5 years 7 months ago #63706 by terminus
I'm having a little trouble getting my head around the Javascript that would be required for this, so in case anyone has the answer, I would love to see it. If not, I'll keep muddling along and post back if I can get it working.

Please Log in to join the conversation.

More
5 years 7 months ago #63714 by tpartner

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
5 years 7 months ago - 5 years 7 months ago #63742 by terminus
Helpful-ish, but with that code it is hiding all of the multiple short text rows, not just the checked ones. For some reason this Javascript:
var el = $('#question'+q2ID+' label[for="answer'+sID+'X'+gID+'X'+q2ID+''+optCode+'"]').parent('li:eq(0)'); 

doesn't correctly target this element, but rather its parent:
<li>
<label for="answer48277X3X2251">Label goes here</label>
	<span>
<input class="text " type="text" size="20" name="48277X3X2251" id="answer48277X3X2251" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);"  maxlength="255" />
	</span>
	</li>
Last Edit: 5 years 7 months ago by terminus.

Please Log in to join the conversation.

More
5 years 7 months ago #63747 by tpartner
Try:
var el = $('#question'+q2ID+' label[for="answer'+sID+'X'+gID+'X'+q2ID+''+optCode+'"]').parents('li:eq(0)');

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
5 years 7 months ago #63749 by terminus
It makes no difference, though interestingly, regardless of that change, it will present correctly when I go forward to the next group and then back to the previous one. I'd prefer for that not to be necessary, of course.

I've sent you a PM suggesting that if you were willing to tinker on my site on this and a couple of other minor issues, I'll donate to the project and/or pay for your time accordingly. Then we could summarise the solution back here.

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form