Question
I'm not able to change embedded field from a keyup event listener.
Hi all,
I'd like to create a function which would put the number of times printscreen key was pressed into the embedded data.
However, I found out that I'm not able to change the value of the embedded field from my event listener. I tried to change HTML of a given element from my function instead and it didn't work neither. There are no errors in the console. Both lines of the work in case they're outside the event listener.
Would anyone have some ideas how to solve this?
Qualtrics.SurveyEngine.addOnload(function()
{
var that = this;
var id = that.questionId;
jQuery("#" + id + " .QuestionText").append('<div id = "my_n">my_n</div>');
jQuery(window).focus();
jQuery(document).keyup(function(e) {
if (e.keyCode == 44)
{
Qualtrics.SurveyEngine.setEmbeddedData('print_screen', "TEST");
jQuery("#my_n").html("TEST");
}
})
});
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
