Welcome, Guest
Username: Password: Remember me

TOPIC: Array question with answers in dropdown boxes

Array question with answers in dropdown boxes 2 years 10 months ago #70081

  • Usapuka
  • Usapuka's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 45
  • 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:

Explorer.png


Firefox.png


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

Thank you in advance, best,

Gabriel
Last Edit: 2 years 10 months ago by Usapuka.
The administrator has disabled public write access.

Re: Array question with answers in dropdown boxes 2 years 10 months ago #70084

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5333
  • Thank you received: 296
  • Karma: 249
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)limesurvey.org'"
The administrator has disabled public write access.

Re: Array question with answers in dropdown boxes 2 years 10 months ago #70093

  • Usapuka
  • Usapuka's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 45
  • 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.

Re: Array question with answers in dropdown boxes 2 years 10 months ago #70117

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5333
  • Thank you received: 296
  • Karma: 249
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)limesurvey.org'"
The administrator has disabled public write access.

Re: Array question with answers in dropdown boxes 2 years 10 months ago #70132

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6451
  • Thank you received: 844
  • Karma: 249
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 :)
The administrator has disabled public write access.
The following user(s) said Thank You: Usapuka

Re: Array question with answers in dropdown boxes 2 years 10 months ago #70152

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4281
  • Thank you received: 807
  • Karma: 370
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.

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: Usapuka

Re: Array question with answers in dropdown boxes 2 years 10 months ago #70157

  • Usapuka
  • Usapuka's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 45
  • 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.

Re: Array question with answers in dropdown boxes 2 years 10 months ago #70168

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5333
  • Thank you received: 296
  • Karma: 249
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)limesurvey.org'"
The administrator has disabled public write access.

Re: Array question with answers in dropdown boxes 2 years 10 months ago #70182

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4281
  • Thank you received: 807
  • Karma: 370
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.

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: Array question with answers in dropdown boxes 2 years 10 months ago #70190

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6451
  • Thank you received: 844
  • Karma: 249
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
Last Edit: 2 years 10 months ago by DenisChenu. Reason: pity :hammer:
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.132 seconds
Donation Image