- Posts: 56
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
<script src="https://cdnjs.cloudflare.com/ajax/libs/inputmask/4.0.9/jquery.inputmask.bundle.min.js"></script> <script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ $('#question{QID} .answer_cell_X001 input[type="text"]').inputmask({ 'mask': '99.99.9999', 'placeholder': 'dd.mm.aaaa', 'removeMaskOnSubmit': false, 'rightAlign': false, }); $('#question{QID} .answer_cell_X002 input[type="text"]').inputmask({ 'mask': '9[9][9]', 'placeholder': '_', 'removeMaskOnSubmit': false, 'rightAlign': false, }); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ var rootPath = location.pathname.split('index.php')[0]; // Identify this question var thisQuestion = $('#question{QID}'); $('head').append('<link rel="stylesheet" href="'+rootPath+'assets/packages/bootstrap/plugins/datetimepicker/build/css/bootstrap-datetimepicker.min.css" type="text/css" />'); $.getScript(rootPath+'assets/packages/bootstrap/plugins/datetimepicker/build/js/bootstrap-datetimepicker.min.js') .done(function(script, textStatus) { // Insert the date-time-pickers $('.answer-item.answer_cell_X001 input:text', thisQuestion).each(function(i) { var thisID = $(this).attr('id'); $(this).addClass('date-control date datetimepicker') .wrap('<div id="datetimepicker_'+thisID+'" class="input-group date date-timepicker-group" />') .after('<div class="input-group-addon datetimepicker-addon btn btn-primary">\ <i class="fa fa-calendar" aria-hidden="true"></i><span class="sr-only"></span>\ </div>'); $('#datetimepicker_'+thisID+'').datetimepicker({ useCurrent:true, allowInputToggle: true, format: 'DD.MM.YYYY' }); }); }) .fail(function( jqxhr, settings, exception ) { console.log(exception); }); }); </script> <script type="text/javascript"> $(document).ready(function(){ $(".datetimepicker").datetimepicker(); }); </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.
Please Log in to join the conversation.
$(document).on('ready pjax:scriptcomplete', function() { var rootPath = location.pathname.split('index.php')[0]; alert(rootPath);
https://www.myServer.com/myLimePath/index.php/[SurveyID]...
Please Log in to join the conversation.