How do i disable my date text field when I'm using date picker to select date? Currently I'm getting multiple date formats in our data although I've setup date picker. I prefer to disable the manual input so folks will use date picker instead. This is the custom code I have setup for my date field. Any suggestions on what is missing? I can still manually enter the dates although it is readonly.
Qualtrics.SurveyEngine.addOnload(function()
{
var textInputs = this.questionContainer.querySelectorAll('input[type="text"]');
if (typeof textInputs[0] !== 'undefined') {
textInputs[0].type = 'date';
}});
Qualtrics.SurveyEngine.addOnReady(function()
{
jQuery("[id='QR~QID10~TEXT']").attr("readonly",true);
});
Qualtrics.SurveyEngine.addOnUnload(function()
{ /*Place your JavaScript here to run when the page is unloaded*/
});
Setting date field as read only while using date picker
Best answer by mingchiat
Thanks Jeremy for your suggestions. Indeed Flatpickr is the better solution and truly versatile.
By adding this additional script in OnLoad, it works.
jQuery("#"+this.questionId+" .InputText").flatpickr({
dateFormat: "m/d/Y"
});
Thank you so much!
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
