Hi, I believe Simple Layout does support JavaScript, but from what I can tell it differs in 2 major ways from the other Layouts.
- jQuery is not included by default and must be loaded in the survey's Header
- Many of the selectors/ids/class names are different from the other Layouts. Where other Layouts would use "#"+this.questionId, it appears to be "#question-"+this.questionId with Simple Layout.
To put flatpickr in place with Simple Layout, first add the below to the Survey's Header:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flatpickr/4.2.3/flatpickr.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flatpickr/4.2.3/themes/dark.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/flatpickr/4.2.3/flatpickr.js"></script>
Next, create a Text Entry question and add the below to the question's JavaScript in the OnReady section:
jQuery("#question-"+this.questionId+" .text-input").flatpickr({
dateFormat: "Y-m-d"
});