Hi @fleb, I ended up going with a different date picker called flatpickr that's a lot lighter and works really well and is really simple to implement. 1. Pick text entry for your question type. 2. Switch to Rich Text Format and hit the source button. Paste this code in there: ``` Enter a date: <link href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css" rel="stylesheet" /> <script src="https://cdn.jsdelivr.net/npm/flatpickr"></script> ``` 3. Inject this javascript bit by hitting the knob on the left. You can make all the range changes here based on the examples on the flatpickr website: ``` Qualtrics.SurveyEngine.addOnload(function() { jQuery("#"+this.questionId+" input[type=text]").flatpickr({minDate:new Date().fp_incr(-30),maxDate:new Date().fp_incr(-1)}); }); ``` Hopefully this helps and thanks for your help too!
Hi @fleb, I tested it out some more and found that just putting the datepicker twice in a survey breaks it in the same way i.e. only the first occurrence of a datepicker question actually displays the calendar and the subsequent ones don't.
Sorry, that link is broken: https://www.qualtrics.com/community/discussion/3802/jquery-does-not-load-the-calendar-in-a-loop-and-merge-block-after-the-first-block#latest
Hi @fleb, I did ask a different question (http://https://www.qualtrics.com/community/discussion/3802/jquery-does-not-load-the-calendar-in-a-loop-and-merge-block-after-the-first-block) and credited you for the code as well. I've figured out how to restrict the date range but hopefully someone can figure this out.
Hi @fleb, I just realized that this is happening - I had not tested it properly. It also occurs when I go "back" in the survey to try and pick a date again. Does that give you any clues? I can' tell if it's an issue with JQuery or the Qualtrics survey engine.
Hi @fleb, I created a number of embedded variables for the maximum number of loops (date1, date2...date30). I then changed a part of your code to read: Qualtrics.SurveyEngine.setEmbeddedData( "date${lm://CurrentLoopNumber}", document.getElementById("datepicker").value ); It's discussed a bit [here].(https://www.qualtrics.com/community/discussion/comment/11807#Comment_11807 "here")
Hi TomG, Thanks, this is great. A quick follow up -how can I use this as a piped text in the loop and merge setting. I'd like to ask something like "How much did you workout on [insert piped text for selected date in that loop]"? I tried this ' ${e://Field/date${lm://CurrentLoopNumber}} ' but it seems like incorrect syntax. Thanks!
Thanks @fleb! This works pretty well. I had a follow-up question since I am using this datepicker now in a loop and merge block. I ask the user to input a certain number and then use that to determine how many times I loop. I ask them to pick a date in each loop and then ask a few questions associated with that date. I'd like to add some kind of custom validation that allows me to ensure that they don't pick the same date twice. Is that possible using this date-picker? Thanks!
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.