Adding Javascript to a single statement in a multi-edit survey question | XM Community

Adding Javascript to a single statement in a multi-edit survey question

  • 1 September 2020
  • 5 replies
  • 62 views

I have created a qualtric Edit Multiple question. In that question I have 4 statements. One of the statements asks the user to provide a date and time for each of 3 scale points. I have the javascript for the date/time picker. But I can't figure out how to add it to any of the statements in the Edit Multiple question. I am able to add this date/time picker to a simple Text Entry survey question but not to a Edit Multiple survey question. Is there a way to do this?


5 replies

Userlevel 7
Badge +27

Yes, there is, but... Do you mean a Side-by-Side question? Can you post an image of it?

qualtrics date and time.jpgThe last statement asks the user to enter a date and time for each course. I'd like to add the javascript to that particular statement.

Attached is what I have for a "Text Entry" question. You can see the javascript button on the left, the javascript and what it looks like when it is displayed. I'm trying to do this for the Multi-edit question but have been unable to do so.
Javascript on single edit question screenshot 1.jpgJavascript on single edit question screenshot 2.jpgJavascript on single edit question screenshot 3.jpg



Userlevel 7
Badge +22

Use this code:

jQuery("#"+this.questionId+" .ChoiceRow:last input[type='text']").flatpickr({enableTime: true, mode:"multiple", dateFormat: "m-d-Y H:i"});


Thank you!!! That worked perfectly!

Leave a Reply