- Posts: 31
- 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() { // Identify this question var thisQuestion = $('#question{QID}'); // Make dates var mindate = new Date(); var maxdate = new Date(); var str= {date1}; // Insert the datepicker $('input[type="text"]', thisQuestion).datepicker({ dateFormat: "dd/mm/yy", minDate: new Date(Date.parse(str.substring(0,9))), maxDate: new Date(); }); // Fix up the datepicker position $('input[type="text"]', thisQuestion).on('click focus', function() { $("#ui-datepicker-div").position({ my: "left top", at: "left-3 top-3", of: $(this) }); }); }); </script>
// Insert the datepicker $('input[type="text"]', q1).datepicker({ showButtonPanel: true, dateFormat: "dd/mm/yy", changeMonth: true, changeYear: true, minDate: "-40y", onSelect : function(e) { var el = $(this); checkconditions($(el).attr('value'), $(el).attr('name'), $(el).attr('type')); }, maxDate: new Date() });