Hi,
I would like to use a text entry question to ask participants how much time they spent sleeping. I am able to get a time picker using flatpickr, but that does not suit my needs since I do not need a time of day such as 20:30. In short, I only require hh and mm as response options. For e.g., total time spent sleeping is 6 hours and 30 minutes. Using multiple boxes is also not an option for hours and minutes separately, since I want the responses to be stored as a single variable. I came across a post where Cleave.Js was offered as an option, however I am unable to programme it to my needs. The error arising is always an unexpected token ‘;’, which I cannot identify within the code. Is anybody able to help or advise? Thank you.
The code is as follows:
Qualtrics.SurveyEngine.addOnReady(function()
{
var lastInput = jQuery("#"+this.questionId+".InputText:last");
new Cleave (lastInput, {
time: true,
timePattern: ['h', 'm']
})};
-Ahuti