Hi guys. So for a survey I'm doing I have a survey question where I used flatpickr to have participants select multiple dates from a calendar (for the purposes of my survey, they will select which days within the past month they have consumed alcohol). This results in a text entry field with whatever dates the participant selected, separated by commas.
I've got all of that implemented just fine; however, for subsequent questions I need the participants to answer, for the days they selected, how many alcoholic drinks they consumed. So it would say "You indicated that you drank on MM/DD/YYYY. On that day, how many drinks did you consume?" They would then answer that question until they have answered it for each date selected. So I'm thinking I'd need piped text to do this, but piped text by default pipes the entire text field. Is there any way to pipe a portion of the text field? If not, is there some other way to have participants answer these questions for the dates they selected?
Pulling specific dates from flatpickr via piped text?
Best answer by rondev
Edited: Create the ED in the survey flow as the very first element.
Here is the code to set ED: Just complete the ed array in line 1
Paste this in the OnReady function of text entry flat pickr question
var ed = ["day1", "day2",............................,"day31"];
var that = this;
jQuery("#NextButton").on('click',function(){
var arr = jQuery("#"+that.questionId+" .InputText").val().split(", ");
for(var i=0; i
Qualtrics.SurveyEngine.setEmbeddedData(ed[i], arr[i]);
}
});
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.
