- Posts: 26
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var SubHeading1="Subtitle 1"; var SubHeading2="Subtitle 2"; var thisQuestion = $('#question{QID}'); // Insert sub-headings $('.checkbox-text-item:eq(0)', thisQuestion).before('<li class="inserted-sub-heading"><span class="myHeader">'+SubHeading1+'</span></li>'); $('.checkbox-text-item:eq(4)', thisQuestion).before('<li class="inserted-sub-heading"><span class="myHeader">'+SubHeading2+'</span></li>'); }); </script>
<style type="text/css"> .myHeader { color:maroon; font-size:120%; margin-left: 25px; } </style>
Please Log in to join the conversation.
Please Log in to join the conversation.
<style> .no-question { border-top:0; } .no-question .question-title-container, .no-question .question-valid-container { display:none; } .no-question .answer-container { padding-top: 0em; padding-bottom: 0.5em; } .no-bottom { border-bottom:0; margin-bottom:0; } .no-bottom .answer-container { padding-bottom: 0em; } </style>
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Seriously????I tried generate some code with chat gpt but it didn't work.
Please Log in to join the conversation.
Please Log in to join the conversation.
Hi,
to insert subheaders you shouldn't use a subquestion and then remove things.
Better you insert a text as a new subheader.
Code:<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var SubHeading1="Subtitle 1"; var SubHeading2="Subtitle 2"; var thisQuestion = $('#question{QID}'); // Insert sub-headings $('.checkbox-text-item:eq(0)', thisQuestion).before('<li class="inserted-sub-heading"><span class="myHeader">'+SubHeading1+'</span></li>'); $('.checkbox-text-item:eq(4)', thisQuestion).before('<li class="inserted-sub-heading"><span class="myHeader">'+SubHeading2+'</span></li>'); }); </script>
I used a class "myHeader" to easily style it.
Code:<style type="text/css"> .myHeader { color:maroon; font-size:120%; margin-left: 25px; } </style>
Please Log in to join the conversation.
Please Log in to join the conversation.