I'm asking for my respondents date of birth. Therefore I'm using a text entry question for which I set response requirements - add validation - content type - date format - dd/mm/yyyy. I like to have it this way that the textbox is already formatted this way --/--/---- --> so the participants don't need to type the / / themselves. Is it possible to pre-format the text-entry? Thanks in advance!
Pre-format text entry to date
Best answer by Tom_1842
Hmm it is working for me. Make sure that cleave is loaded in the survey's header:
<script src="https://cdn.jsdelivr.net/npm/cleave.js@1/dist/cleave.min.js"></script>And then add the below to the OnReady section of the question's JavaScript:
new Cleave(jQuery("#"+this.questionId+" .InputText").get(0), {
date: true,
delimiter: '/',
datePattern: ['Y', 'm', 'd']
});If you are using Simple layout, you will also need to add jQuery to the survey's header:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/cleave.js@1/dist/cleave.min.js"></script>And then add the below to the OnReady section of the question's JavaScript:
new Cleave(jQuery("#question-"+this.questionId+" .text-input").get(0), {
date: true,
delimiter: '/',
datePattern: ['Y', 'm', 'd']
});
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.
