Welcome, Guest
Username: Password: Remember me

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

Filter "multiple short text" question with answers from previous multiple-choice 3 years 1 month ago #63706

  • terminus
  • terminus's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • 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.

Re: Filter "multiple short text" question with answers from previous multiple-choice 3 years 1 month ago #63714

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4120
  • Thank you received: 760
  • Karma: 346
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.

Re: Filter "multiple short text" question with answers from previous multiple-choice 3 years 1 month ago #63742

  • terminus
  • terminus's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • 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: 3 years 1 month ago by terminus.
The administrator has disabled public write access.

Re: Filter "multiple short text" question with answers from previous multiple-choice 3 years 1 month ago #63747

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4120
  • Thank you received: 760
  • Karma: 346
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Filter "multiple short text" question with answers from previous multiple-choice 3 years 1 month ago #63749

  • terminus
  • terminus's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • 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.
Moderators: ITEd
Time to create page: 0.127 seconds
Donation Image