- Posts: 31
- Thank you received: 1
Ask the community, share ideas, and connect with other LimeSurvey users!
var qID = {QID}; var select = '<div id="insertedNo"> \ <input type="numeric-item text-item numberonly" title="" name="no" /> \ </div>'; $('#question'+qID+' .answer_cell_1_001' input.radio').hide(); $('#question'+qID+' .answer_cell_1_001').append(select);
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var qID = {self.qid}; var newSelect = '<div id="insertedNo"> \ <input type="numeric-item text-item numberonly" title="" name="no" /> \ </div>'; $('#question'+qID+' .answer_cell_1_001 input.radio').hide(); $('#question'+qID+' .answer_cell_1_001').append(newSelect); }); </script>
Really strange this issue, {QID} must be allways replaced by the question QID (if use in a question). There are a bug heretpartner wrote: To return the question ID for a dual scale array you need to use "{self.qid}" (no idea why).
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var qID = {self.qid}; var newSelect1 = '<div id="insertedNo1"> \ <input type="numeric-item text-item numberonly" title="" name="no1" /> \ </div>'; var newSelect2 = '<div id="insertedNo2"> \ <input type="numeric-item text-item numberonly" title="" name="no2" /> \ </div>'; $('#question'+qID+' .answer_cell_1_001 input.radio').hide(); $('#question'+qID+' .answer_cell_2_001 input.radio').hide(); $('#question'+qID+' .answer_cell_1_001').append(newSelect1); $('#question'+qID+' .answer_cell_2_001').append(newSelect2); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var qID = {self.qid}; var newSelect1 = '<div id="insertedNo1"> \ <input type="numeric-item text-item numberonly" title="" name="no1" /> \ </div>'; var newSelect2 = '<div id="insertedNo2"> \ <input type="numeric-item text-item numberonly" title="" name="no2" /> \ </div>'; $('#question'+qID+' .answer_cell_1_001:first input.radio').hide(); $('#question'+qID+' .answer_cell_2_001 input.radio').hide(); $('#question'+qID+' .answer_cell_1_001:first').append(newSelect1); $('#question'+qID+' .answer_cell_2_001').append(newSelect2); }); </script>
$('#question'+qID+' .answer_cell_1_001:eq(1) input.radio').hide(); $('#question'+qID+' .answer_cell_2_001 input.radio').hide(); $('#question'+qID+' .answer_cell_1_001:eq(1)').append(newSelect1); $('#question'+qID+' .answer_cell_2_001').append(newSelect2);