- Posts: 222
- Thank you received: 10
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
List with comment - hiding text label
- krosser
- Topic Author
- Offline
- Elite Member
Less
More
5 years 8 months ago #172698
by krosser
I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
List with comment - hiding text label was created by krosser
Hey guys,
I'm trying to effectively hide the text label with a JS code.
I've written this code, which hides the label. It works but am not sure if it's really correct. So, if someone can check it out as well, I would appreciate it.
I've also added some text inside the comment (which is why I want to hide the label in the first place).
Cheers
I'm trying to effectively hide the text label with a JS code.
I've written this code, which hides the label. It works but am not sure if it's really correct. So, if someone can check it out as well, I would appreciate it.
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ var thisQuestion = $('#question{QID}'); $('.form-group.answer-item.text-item.col-sm-6.col-xs-12 .control-label', thisQuestion).hide(); }) </script>
I've also added some text inside the comment (which is why I want to hide the label in the first place).
Cheers
I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10103
- Thank you received: 3591
5 years 8 months ago #172704
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 List with comment - hiding text label
That would work but you can also do it with CSS.
1) Assign a CSS class "hidden-textarea-label" to the question.
2) Add this to the end of your theme custom.css file:
1) Assign a CSS class "hidden-textarea-label" to the question.
2) Add this to the end of your theme custom.css file:
Code:
.hidden-textarea-label .text-item label { display: none; }
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: krosser
The topic has been locked.
- krosser
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 222
- Thank you received: 10
5 years 8 months ago #172707
by krosser
I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
Replied by krosser on topic List with comment - hiding text label
Nice! Thanks man. So you think hiding it with CSS is better?
I wrote this CSS code but for all such questions.
So, your code is more sophisticated. I couldn't figure out this part myself - ".text-item label" :pinch:
I wrote this CSS code but for all such questions.
Code:
.form-group.answer-item.text-item.col-sm-6.col-xs-12 .control-label { display: none; }*
So, your code is more sophisticated. I couldn't figure out this part myself - ".text-item label" :pinch:
I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10103
- Thank you received: 3591
5 years 8 months ago #172709
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 List with comment - hiding text label
It's always better to do it with pure CSS if you can.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: krosser
The topic has been locked.