Question
minDate for Calendar works work with "Preview Question" but not Preview Block or Preview Survey
I am trying to restrict the date that a person can pick on a date picker question. The code I am using works when I click "Preview Question" but not when I click "Preview Block" or "Preview Survey". I tried publishing the survey to see if that made a difference, but it did not. Thoughts?
HEADER CODE
link href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet" /><script src="https://code.jquery.com/jquery-1.12.4.js"></script><script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"
JAVASCRIPT CODE
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
jQuery("#"+this.questionId+" .InputText").datepicker({
dateFormat: 'yy-mm-dd',
minDate : "${date://CurrentDate/DS +7}",
}).attr('readonly', true);
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
jQuery("#ui-datepicker-div").remove();
});
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
