- Posts: 31
- Thank you received: 1
Ask the community, share ideas, and connect with other LimeSurvey users!
$(document).ready(function() { var qID = {QID}; var inputNum = 1; $('#question'+qID+' li:eq('+(inputNum+6)+')').append($(function() { .datepicker({ dateFormat: "dd/mm/yy",changeMonth: true, changeYear: true })});); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ var qID = {QID}; // Apply the datepicker to the second text input $('#question'+qID+' input[type="text"]:eq(1)').datepicker({ dateFormat: "dd/mm/yy", changeMonth: true, changeYear: true }); }); </script>
tpartner wrote: Okay, for the benefit of others, it seems that you want to apply a date-picker to the second text input of a multiple-short-text question.
Placing this script in the source of the question will accomplish that:Code:<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ var qID = {QID}; // Apply the datepicker to the second text input $('#question'+qID+' input[type="text"]:eq(1)').datepicker({ dateFormat: "dd/mm/yy", changeMonth: true, changeYear: true }); }); </script>
Here is your survey back with the amended code.