Time question (Date question-like) is not working

More
4 years 5 months ago #86975 by amritdeep
I am using Time question (Date question-like) to submit the time
The code mentioned in workaround is not working.
I am using the following code in source code

Time question

<script src="/upload/surveys/{SID}/jquery-ui-timepicker-addon.js"></script>

<script>
$(document).ready(function(){

$('#answer{SGQ}').timepicker({
timeText: 'Time', //here translation
hourText: 'hour', //here translation
minuteText: 'minute', //here translation
closeText: 'Done' //here translation
});

$('#answer{SGQ}').attr('readonly', 'readonly');

$( "<style>"
+".ui-widget-header, .ui-datepicker-current { display:none; }"
+".ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }"
+".ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }"
+" }"
+"</style>").appendTo( "head" );

});
</script>


and Question type is : short free text.

Please Log in to join the conversation.

More
4 years 5 months ago - 4 years 5 months ago #86983 by floccs
Download the file at http://trentrichardson.com/examples/timepicker/jquery-ui-timepicker-addon.js and upload it to your survey.
Notice that the workaround has been tested only under Limesurvey 1.92+
Last Edit: 4 years 5 months ago by floccs.

Please Log in to join the conversation.

More
4 years 5 months ago #87049 by amritdeep
The link trentrichardson.com/examples/timepicker/...-timepicker-addon.js is not working.
it shows


Forbidden

You don't have permission to access /examples/timepicker/jquery-ui-timepicker-addon.js on this server.

Please Log in to join the conversation.

More
4 years 5 months ago #87064 by tpartner
Have a look at Mobiscroll - Demo.mobiscroll.com/#Demo=datetime&mode=clickpick . I've tested it successfuly on both PCs and iPads.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
4 years 5 months ago - 4 years 5 months ago #87069 by floccs
Please, retry (no copy/paste the link, just click). Here it's working
Last Edit: 4 years 5 months ago by floccs.

Please Log in to join the conversation.

More
4 years 5 months ago #87149 by amritdeep
Now link is working. where i have to place this .js file ???

Please Log in to join the conversation.

More
4 years 5 months ago #87150 by DenisChenu

tpartner wrote: Have a look at Mobiscroll - Demo.mobiscroll.com/#Demo=datetime&mode=clickpick . I've tested it successfuly on both PCs and iPads.

Hello,

I really think we have to:
- Use input type="date" or input type="time" for date/time question type.
- Use js only if browser don't understand type="date/time" input, and DON'T sue js if browser understand input type.

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
4 years 5 months ago #87189 by amritdeep
Am sorry to say but i didn't understand how to use input type "time"

Please Log in to join the conversation.

More
4 years 5 months ago #87193 by DenisChenu

amritdeep wrote: Am sorry to say but i didn't understand how to use input type "time"

Sorry, it's a a developer comment. It's for LS 2.0.

Here, with 1.92, you have to use some js workaround.

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
4 years 5 months ago #87194 by amritdeep
I am using Time question (Date question-like) workaround. Where i have to place trentrichardson.com/examples/timepicker/...-timepicker-addon.js file in my survey.

Please Log in to join the conversation.

More
4 years 5 months ago #87198 by floccs
You have to upload the script as a resource from the general settings of your survey.

Please Log in to join the conversation.

More
4 years 5 months ago - 4 years 5 months ago #87200 by amritdeep
After uploading the script as a resource the following warning is displayed


Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\limesurvey\admin\import_resources_zip.php on line 190
Last Edit: 4 years 5 months ago by amritdeep.

Please Log in to join the conversation.

More
4 years 5 months ago - 4 years 5 months ago #87203 by floccs
Did you zip the file?
Last Edit: 4 years 5 months ago by floccs.

Please Log in to join the conversation.

More
4 years 5 months ago #87204 by amritdeep
yes. I have zip the file "jquery-ui-timepicker-addon.js" to "jquery-ui-timepicker-addon.zip". Then i have browse the zip file as resource in general setting of survey and then click on "Import Resouces ZIP archive" button

Please Log in to join the conversation.

More
4 years 5 months ago #87205 by floccs
I'm sorry but I can't help you anymore. In my installation it's all working fine

Please Log in to join the conversation.