- Posts: 1
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { $('.date .day ').hide(); $('.date .day option:eq(1)').attr('selected', 'selected'); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { $('.date .day').hide(); $('.date .day').each(function(){ $('option:eq(1)', this).attr('selected', 'selected'); }); }); </script>
You're welcome!aeso wrote: Fantastic, this works perfectly! Wonderful work!
tpartner wrote: This should do the trick:
Code:<script type="text/javascript" charset="utf-8"> $(document).ready(function() { $('.date .day').hide(); $('.date .day').each(function(){ $('option:eq(1)', this).attr('selected', 'selected'); }); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Identify this question var qID = {QID}; var thisQuestion = $('#question'+qID); // Hide the day dropdown $('select.day', thisQuestion).hide(); // Set the day to 1 $('select.day option:eq(1)', thisQuestion).attr('selected', 'selected'); // Hide the first separator "-" character $('.answer-item', thisQuestion).contents().not('label, select, input, :empty').wrap('<span class="date-separator" />'); $('span.date-separator:eq(0)', thisQuestion).hide(); }); </script>
tpartner wrote: Here is an updated version for 2.05. Add this script to the source of every date question you want affected.
Code:<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Identify this question var qID = {QID}; var thisQuestion = $('#question'+qID); // Hide the day dropdown $('select.day', thisQuestion).hide(); // Set the day to 1 $('select.day option:eq(1)', thisQuestion).attr('selected', 'selected'); // Hide the first separator "-" character $('.answer-item', thisQuestion).contents().not('label, select, input, :empty').wrap('<span class="date-separator" />'); $('span.date-separator:eq(0)', thisQuestion).hide(); }); </script>