- Posts: 352
- Thank you received: 41
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Identify this question var thisQuestion = $('#question{QID}'); // Insert the modified labels $('.control-label', thisQuestion).each(function(i) { var thisRow = $(this).closest('.answer-item'); var labels = $(this).text().split(',') $('input.text', thisRow).before('<span class="inserted-prefix">'+$.trim(labels[0])+'</span>'); $('input.text', thisRow).after('<span class="inserted-suffix">'+$.trim(labels[1])+'</span>'); }); // Some cleanup styling $('.control-label', thisQuestion).css({ 'display': 'none' }); $('.form-group.row > div', thisQuestion).css({ 'float': 'none', 'width': 'auto' }); $('input.text', thisQuestion).css({ 'display': 'inline-block', 'margin': '0 15px', 'width': '75px' }); }); </script>