- Posts: 9
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
script to hide an entire question
- jcruz
- Topic Author
- Offline
- New Member
Less
More
8 years 3 months ago #128747
by jcruz
script to hide an entire question was created by jcruz
I'm playing around of the things scripting can do to manipulate the behavior of the survey. And I was wondering how to hide a question (including the subquestions and everything) using a script. I know this thing can be done in a snap when initializing the question. But how to do this with a script?
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13907
- Thank you received: 2546
8 years 3 months ago #128755
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic script to hide an entire question
Hi,
In question text HTML source
In question text HTML source
Code:
<script> $(function() { $("#question{QID}").hide(); }); </script>
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- jcruz
- Topic Author
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 0
8 years 3 months ago #128799
by jcruz
Replied by jcruz on topic script to hide an entire question
Hi Denis,
Thanks for your reply! I've actually thought of this exact script. But it's not working. I actually came up with the scripts that hide subquestions but never the entire question container. Having said that, I am sure that I have enabled Javascript. It's just that I can't select the right element in my scripts. Is "#questionSSSSXGGXQQ" really the right id? I'm not quite sure about my version of LS but administrator said last update was early this year I think.
Thanks for your reply! I've actually thought of this exact script. But it's not working. I actually came up with the scripts that hide subquestions but never the entire question container. Having said that, I am sure that I have enabled Javascript. It's just that I can't select the right element in my scripts. Is "#questionSSSSXGGXQQ" really the right id? I'm not quite sure about my version of LS but administrator said last update was early this year I think.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11746
- Thank you received: 2750
8 years 3 months ago #128800
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic script to hide an entire question
You should see the version of LS in the footer of the administration pages.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- jcruz
- Topic Author
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 0
8 years 3 months ago #128801
by jcruz
Replied by jcruz on topic script to hide an entire question
Thanks everyone! I misunderstood {QID} being the whole SGQA indentifier. When I only used question id alone, it worked.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13907
- Thank you received: 2546
8 years 3 months ago #128804
by DenisChenu
Please : READ THE MANUAL :
- manual.limesurvey.org/Expression_Manager#Access_to_Variables
- manual.limesurvey.org/Workarounds:_Manip...ime_using_Javascript
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic script to hide an entire question
If you read : i put #question{QID} not anything else.jcruz wrote: !..... Is "#questionSSSSXGGXQQ" really the right id?....
Please : READ THE MANUAL :
- manual.limesurvey.org/Expression_Manager#Access_to_Variables
- manual.limesurvey.org/Workarounds:_Manip...ime_using_Javascript
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: jcruz
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
8 years 3 months ago #128806
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic script to hide an entire question
I think Denis' point is that you don't need to replace "{QID}" with anything - LimeSurvey will automatically insert the ID.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.