hide questions, execute jquery code.

More
5 years 8 months ago - 5 years 8 months ago #75935 by mmirasol
mmirasol created the topic: hide questions, execute jquery code.
Hello Guys,

I'm wondering if there's a way to hide questions in lime. At the moment, I have to use css to hide certain questions. I saw the attribute 'always hide this question' but observed that it excludes the question completely instead of just adding style='display:none'.

An example of a question I need is like the one in the attached a6 image. I created a multi text array, added an html textbox for the 'other, please specify' box and jquery code to record the input text in a hidden short text question.

Is there a quicker way to do this in lime?
Attachments:
Last Edit: 5 years 8 months ago by mmirasol.

Please Log in to join the conversation.

More
5 years 8 months ago #75937 by TMSWhite
TMSWhite replied the topic: hide questions, execute jquery code.
Another option is to create an always-hidden Equation question and have your jQuery populate it. Hidden Equations are always present in the JavaScript since their values may be used for branching, validation, or tailoring (unlike other always-hidden questions, which have no HTML rendered at all, as you saw. Values entered into Equation questions are stored in the database.

If you feel like hacking LimeSurvey code, there is already an "other" option for many other question types. It would be nice to have it available for array type questions in the manner your display. If it were, all of the array_filter and array_filter_exclude logic would immediately work for them, so it's just a matter of tweaking qanda.php

Please Log in to join the conversation.

More
5 years 8 months ago - 5 years 8 months ago #75938 by mmirasol
mmirasol replied the topic: hide questions, execute jquery code.
Hi Tom,

Thanks for the advise. I will have a look at these files. =) BTW, how is v1.92 going? Do we have a new scheduled date for the stable release? =)

Mark
Last Edit: 5 years 8 months ago by mmirasol.

Please Log in to join the conversation.

More
5 years 8 months ago #75939 by TMSWhite
TMSWhite replied the topic: hide questions, execute jquery code.
It was quietly released last Friday. You can get it here: www.limesurvey.org/en/download

Please Log in to join the conversation.

More
5 years 8 months ago #75940 by mmirasol
mmirasol replied the topic: hide questions, execute jquery code.
oh. hehe thanks. I've been waiting for an announcement on the front page. =)

Please Log in to join the conversation.

More
5 years 8 months ago #75966 by DenisChenu
DenisChenu replied the topic: hide questions, execute jquery code.

TMSWhite wrote: Another option is to create an always-hidden Equation question and have your jQuery populate it. Hidden Equations are always present in the JavaScript since their values may be used for branching, validation, or tailoring (unlike other always-hidden questions, which have no HTML rendered at all, as you saw. Values entered into Equation questions are stored in the database.

Hello Tom,

Why don't have :
hidden attribute:
- No
- Completely remove from HTML
- Hide in CSS

For all question type ?

Actual "hidden" become Completely remove from HTML for compatibility issue.

I think some user can hide completly some validation question to activate after some month when it's needed for example :).

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
5 years 8 months ago #76005 by TMSWhite
TMSWhite replied the topic: hide questions, execute jquery code.
Denis-

The three options for always-hidden are exactly what Carsten recommends for the future (e.g. 2.0, and possibly 1.92+)

/Tom
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

More
5 years 8 months ago #76011 by DenisChenu
DenisChenu replied the topic: hide questions, execute jquery code.

TMSWhite wrote: The three options for always-hidden are exactly what Carsten recommends for the future (e.g. 2.0, and possibly 1.92+)

Oups ...
:blush:

:hammer:

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
6 months 2 weeks ago #153889 by tammo
tammo replied the topic: hide questions, execute jquery code.


Tammo ter Hark at Tools for Research
Proud developers of the TFR Responsive Limesurvey template
toolsforresearch.com/limesurvey-responsive-template

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!