Entering clock times without typing in text boxes but focusing on Javascript not working | XM Community
Skip to main content

I followed the community post: “How can a participant enter clock times without typing in text boxes?” and added the header for the library flatpickr and the javascript into the question box but nothing happened. When I preview and test the question, the text box is still just a text box. 

There were no changes made to the question text box and I lack any background in javascript to understand what is missing. Here is the link to the code: https://docs.google.com/document/d/1K2gFmFSx3-377FvT0mTyrXmSAiJbLCWZi6LrCS_VKSw/edit

 

And here is what our question looks like. 

 

We need multiple time entries into the text boxes. I would appreciate any help or guidance!

Hi,

You might have to style it a bit more to attain something that looks good, but start with :

Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/

var calendars = jQuery("#"+this.questionId+" input[type='text']").flatpickr({
enableTime: true,
noCalendar: true,
dateFormat: "H:i",
minuteIncrement: 15
});

});

 


Hi vgayraud,

I truly appreciate your help! However I’m still running into the same issue where no changes are occurring. Is there something preliminary that I have to turn on to make javascript work? Is there a short code I can use on any question to see if Qualtrics is reading javascript correctly?

 

Thanks so much!


In the header, were you in source mode?

 


I was not! That worked!! Thank you so much. Not all heroes wear capes.


Leave a Reply