Datepicker not working when Qualtrics validation failed (Force response, invalid email etc.) | XM Community
Skip to main content
in the survey, We have requirement to add a datepicker question ,I have used below code, which is working fine.

jQuery("[id='QR~QID59']").datepicker(

{

dateFormat: 'dd/mm/yy',

minDate: '-30d',

maxDate: '+0d',

changeMonth: true,

changeYear: true

});

!



There are few more mandatory question on that page. If some one click next button without answering any of those question qualtrics show correct error that answer is missing. But after that when I click on the datepicker textbox datepicker stop functioning (i.e. calendar is not showing).



_Note:I don't want to use datepicker question from Qualtrics library



Someone faced faced/solved this issue before?
Hello @YASH1T ,



Paste the below code in the js(onReady) of the datepicker question



jQuery( "[id='QR~"+this.questionId+"']" ).datepicker({

dateFormat: 'dd/mm/yy',

minDate: '-30d',

maxDate: '+0d',

changeMonth: true,

changeYear: true

});



Paste the below code in js(onUnload) of the datepicker question

`jQuery("#ui-datepicker-div").remove();`

Leave a Reply