Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

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

Filter "multiple short text" question with answers from previous multiple-choice 5 years 4 months ago #63706

  • terminus
  • terminus's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
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.
The administrator has disabled public write access.

Filter "multiple short text" question with answers from previous multiple-choice 5 years 4 months ago #63714

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6567
  • Thank you received: 1477
  • Karma: 578
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

Filter "multiple short text" question with answers from previous multiple-choice 5 years 4 months ago #63742

  • terminus
  • terminus's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
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 4 months ago by terminus.
The administrator has disabled public write access.

Filter "multiple short text" question with answers from previous multiple-choice 5 years 4 months ago #63747

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6567
  • Thank you received: 1477
  • Karma: 578
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.
The administrator has disabled public write access.

Filter "multiple short text" question with answers from previous multiple-choice 5 years 4 months ago #63749

  • terminus
  • terminus's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
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.
The administrator has disabled public write access.
Time to create page: 0.795 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form