Javascript - Time Picker | XM Community
Solved

Javascript - Time Picker

  • 13 September 2018
  • 3 replies
  • 72 views

Badge +3
We have two questions where we have entered the following javascript. We want the respondent to be able to pick the opening time in question one and the closing time in question two.....however when the data is entered the opening time is recorded for both question 1 and question 2. thoughts?

Javascript:
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/

});

Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/

var Qbd = "input[id='QR~"+this.questionId+"']";

jQuery("#" + this.questionId + " .InputText").hide();

jQuery("#appt-time").on(" change", function() {

jQuery(Qbd).val(jQuery("#appt-time").val()) ;

});

});

Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/

});
icon

Best answer by Sona 13 September 2018, 18:20

View original

3 replies

Userlevel 2
Badge +1
Hey @arushman ,

Is your question one and question two on separate pages, if not then please do and check.
Hope this helps.
Badge +3
YES -- that is what it needed! THANK YOU!
Badge +2
is it possible to make it in 24 hr format?

Leave a Reply