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

TOPIC: Array question with answers in dropdown boxes

Array question with answers in dropdown boxes 5 years 4 days ago #70081

  • Usapuka
  • Usapuka's Avatar
  • Offline
  • Senior Lime
  • Posts: 75
  • Thank you received: 1
  • Karma: 0
Hi,

I did an "Array question with answers in dropdown boxes" in accordance with: http://www.limesurvey.org/en/forum/can-i-do-this-with-limesurvey/58190-array-question-with-answers-in-dropdown-boxes.
I am using 5 answers possibilities: in the first column you can see the 5 answers, in the second I hide one and in the third I hide two.

With Mozilla Firefox and Chrome the hidden answers are really hidden but with Internet Explorer there is an "empty space" in the space of the hidden answers. And these "empty space" can be selected, which is incorrect. Please see the screen shots:





What can I do, in order to really hide the answers using Internet Explorer?

Thank you in advance, best,

Gabriel
Last Edit: 5 years 4 days ago by Usapuka.
The administrator has disabled public write access.

Array question with answers in dropdown boxes 5 years 4 days ago #70084

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6027
  • Thank you received: 373
  • Karma: 260
Seems like a browser issue. Are there any JS error messages? Which IE version are you using?

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The administrator has disabled public write access.

Array question with answers in dropdown boxes 5 years 4 days ago #70093

  • Usapuka
  • Usapuka's Avatar
  • Offline
  • Senior Lime
  • Posts: 75
  • Thank you received: 1
  • Karma: 0
Mazi,

Thank you for your answer.

There is not an JS error massage.

I have the same problem with IE 8 and IE 9 (another computer). The "hide()" don't hide. I put a number in text('number') instead of '', and in Firefox and Chrome the number is hidden and not in IE.

Best,

Gabriel
The administrator has disabled public write access.

Array question with answers in dropdown boxes 5 years 4 days ago #70117

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6027
  • Thank you received: 373
  • Karma: 260
I guess that there are differences between the browser on how they deal with the hide() option. This might be a jQuery related problem. Maybe Google has some further hints for you.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The administrator has disabled public write access.

Array question with answers in dropdown boxes 5 years 4 days ago #70132

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9555
  • Thank you received: 1374
  • Karma: 389
Hello,

Why don't remove the option, hiding an option aren't the best solution, clearly I think FF make an error here (I'm not sure you can have a display:none on a option :)).

With remove() , it's clean for IE too.

Denis :)
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time (Need support ?).
A bug not reported is a bug not corrected. | 2.61lts version improved | Need plugins for LimeSurvey ?
The administrator has disabled public write access.
The following user(s) said Thank You: Usapuka

Array question with answers in dropdown boxes 5 years 4 days ago #70152

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6567
  • Thank you received: 1477
  • Karma: 579
Denis is correct.

In the linked solution, this:
$('#question298 .answer_cell_00SQ002 option[value=5]').text('').hide();

Should be this:
$('#question298 .answer_cell_00SQ002 option[value=5]').remove();
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.
The following user(s) said Thank You: Usapuka

Array question with answers in dropdown boxes 5 years 4 days ago #70157

  • Usapuka
  • Usapuka's Avatar
  • Offline
  • Senior Lime
  • Posts: 75
  • Thank you received: 1
  • Karma: 0
Thank you Denis and Tony,

Yes, "remove()" is the solution. I tried with IE 8 and 9 and works well.

Best,

Gabriel
The administrator has disabled public write access.

Array question with answers in dropdown boxes 5 years 4 days ago #70168

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6027
  • Thank you received: 373
  • Karma: 260
Tony, does that problem show up for drop down lists only? Because we use the hide() function quite often under different circumstances.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The administrator has disabled public write access.

Array question with answers in dropdown boxes 5 years 4 days ago #70182

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6567
  • Thank you received: 1477
  • Karma: 579
Yes, <option> elements are oddballs - they don't respond well to display:none in all browsers so they need to be removed from the DOM.

It can be a bit of a problem if you want to hide them and then dynamically show them again. In that case I use .clone() to store a copy of the dropdown to use for re-showing the option(s).
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.

Array question with answers in dropdown boxes 5 years 4 days ago #70190

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9555
  • Thank you received: 1374
  • Karma: 389
tpartner wrote:
In that case I use .clone() to store a copy of the dropdown to use for re-showing the option(s).
Yep,

Sometime i move() the select box, create another one and clone only the option i need after .... :side: and put a listener on the second select to update the first :blink: .


PS: What a pity, we don't have :hammer: smiley
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time (Need support ?).
A bug not reported is a bug not corrected. | 2.61lts version improved | Need plugins for LimeSurvey ?
Last Edit: 5 years 4 days ago by DenisChenu. Reason: pity :hammer:
The administrator has disabled public write access.
Time to create page: 0.261 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form