Welcome, Guest
Username: Password: Remember me

TOPIC: Hiding boxes by element ID in ranking question?

Hiding boxes by element ID in ranking question? 3 years 3 months ago #63527

  • tomf
  • tomf's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
Hello. I have done plenty of reading, and seen how workarounds are done... but still cannot find the solution to what I need to do. I'm pretty sure it is possible.

I have set up a survey, including one 'ranking' type question. We only want to ask for the top three out of 10 possible choices, so I have set 'minimum answers' to 3 in advanced settings for that question, and turned off mandatory.

Now all that is left to do is HIDE the ranking boxes for #4 through #10, so that the user only sees three boxes. I thought that this would be straightforward using the Template Editor.

This is question 4 in my survey, so the ranking boxes have ID's such as RANK_44, RANK_45, etc.

So I edited template.css in an attempt to hide the ranking boxes by their ID, such as this:

#RANK_44 { display: none; }
#RANK_45 { display: none; }
#RANK_46 { display: none; }
#RANK_47 { display: none; }
#RANK_48 { display: none; }
#RANK_49 { display: none; }
#RANK_410 { display: none; }

Unfortunately, this does not work. All 10 boxes are still visible. Either I am making a CSS error, or there is something else that I am missing.

Anyone have a fix for this?

Thank you very much!
Last Edit: 3 years 3 months ago by tomf.
The administrator has disabled public write access.

Re: Hiding boxes by element ID in ranking question? 3 years 3 months ago #63597

  • tomf
  • tomf's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
LimeSurvey gurus? developers? anyone?
The administrator has disabled public write access.

Re: Hiding boxes by element ID in ranking question? 3 years 3 months ago #63600

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1116
  • Thank you received: 251
  • Karma: 78
I don't know exactly the CSS background for the ranking questions, but maybe you've to look
around this kind of CSS properties :nth-child ( :nth-of-type, :first-child, :last-child. etc.).
It could be better in your case than using only #ID{display:none}
You'll find here some resources:
(It's in French but with a lot of graphic examples)

Benoît
Benoît

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
Last Edit: 3 years 3 months ago by Ben_V.
The administrator has disabled public write access.

Re: Hiding boxes by element ID in ranking question? 3 years 3 months ago #63627

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6435
  • Thank you received: 840
  • Karma: 249
BAD ANSWER :(

Hello,

You can't "hide" option in css i think.

But you can "remove" it with jquery. If your question are question 42 for example, and your choice are A1, A2, A3, A4 and you want to remove the first item. I think you can do something like that in javascript.
<script type="text/javascript" charset="utf-8">
jQuery(document).ready(function () {
$("#CHOICES_42 option:eq(0)").remove();
});
</script>

[edit]
Sorry, i didn't read the question .... tpartner have right
Last Edit: 3 years 3 months ago by DenisChenu.
The administrator has disabled public write access.

Re: Hiding boxes by element ID in ranking question? 3 years 3 months ago #63634

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4271
  • Thank you received: 806
  • Karma: 369
Set "Maximum answers" to 3, not "Minimum answers".
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.
Last Edit: 3 years 3 months ago by tpartner.
The administrator has disabled public write access.

Re: Hiding boxes by element ID in ranking question? 3 years 3 months ago #63647

  • tomf
  • tomf's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
tpartner, your solution was exactly what i needed ... i guess i was over-complicating the issue and not seeing the obvious!

thank you very much!

:-)
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.126 seconds
Donation Image