- Posts: 57
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
Please Log in to join the conversation.
.no-question{border-top:0;} .no-question .question-title-container{display:none;} .no-question .question-valid-container{display:none;} .no-bottom{border-bottom:0;margin-bottom:0;} .no-question .answer-container { padding-top: 0em; padding-bottom: 0.5em; } .no-bottom .answer-container { padding-bottom: 0em; }
<style type="text/css"> label.control-label { text-align: left !important; } ul.ls-answers { margin-bottom: 0em; } .ls-answers { padding-bottom: 0; } </style>
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:complete',function() { var qID = {QID}; var inputNum = 1; // Adapt to your needs // Define the select element (dropdown) var prov1 = '<select id="prov1" class="form-control">\ <option value="">--Please, select--</option>\ <option value="1">Option 1</option>\ <option value="2">Option 2</option>\ <option value="3">Option 3</option>\ <option value="4">Option 4</option>\ </select>'; // Hide the text input $('#question'+qID+' .question-item:eq('+(inputNum-1)+') input[type="text"]').hide(); // Insert the select elements if($('#question'+qID+' .question-item:eq('+(inputNum-1)+') select').length == 0) { $('#question'+qID+' .question-item:eq('+(inputNum-1)+') input[type="text"]').before(prov1); } // Initially select an option if the question has already been answered $('#question'+qID+' select').each(function(i) { if($.trim($(this).next('input[type="text"]').val()) != '') { $(this).val($.trim($(this).next('input[type="text"]').val())); } }); // Listener on the dropdowns - insert selected values into hidden text input $('#question'+qID+' select').change(function() { var thisInput = $(this).next('input[type="text"]'); $(thisInput).val($(this).val()); checkconditions($(thisInput).attr('value'), $(thisInput).attr('name'), 'text'); }); // Some styles $('#question'+qID+' select').css({ 'margin':'0.3em 0 0 0' }); }); </script>
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:complete',function() { alert("Hello, javascript speaking"); });
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.