Hi all,
I'm running into an issue where it appears input entered into a survey in an earlier question is being overwritten, and my output is showing up as the same value even though different values were entered into the survey.
Here is example javascript added to two different survey questions:
Question 1 (under edit question 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 Fbd1 = "input[id='QR~"+this.questionId+"']";
jQuery("#" + this.questionId + " .InputText").hide();
jQuery("#appt-time").on(" change", function() {
jQuery(Fbd1).val(jQuery("#appt-time").val()) ;
});
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
});
Question 2 (under edit question 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 Fbd2 = "input[id='QR~"+this.questionId+"']";
jQuery("#" + this.questionId + " .InputText").hide();
jQuery("#appt-time").on(" change", function() {
jQuery(Fbd2).val(jQuery("#appt-time").val()) ;
});
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
});
The first question is "What was your bedtime?"
The second question is "What was your wake time?"
I have noticed whatever is entered into the second question seems to be overwriting the output for the first question. For example, if I respond 8:00PM for the first question and 4:00AM for the second question, in the output both answers are showing up as 8:00PM.
I am not great with Javascript and I am thinking this has something to do with the custom javascript code that I have added. Any and all input would be greatly appreciated.
Thank you.
Solved
Output in Qualtrics Survey is the same after using a javascript mask
Best answer by sdeering
@MatthewM,
I ended up getting it sorted out. It had to do with the Javascript and not the HTML, but I just would like to thank you again for reaching out so quickly to try to help!
Cheers,
Sean
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
