Hi everyone
I am trying to store the answers to two numeric questions with a Javascript into an EmbeddedData Field. I would like to do so on the same page as the question. Currently I save the data in an additional hidden question, but what do I have to add to my code so that it works without additional hidden question?
Here is my code so far:
!
Thanks a lot
Page 1 / 1
Assuming your numeric questions are single text entry questions, add this script to each question (change the embedded variable):
```
Qualtrics.SurveyEngine.addOnPageSubmit(function() {
var answer = jQuery("#"+this.questionId+" .InputText").val();
Qualtrics.SurveyEngine.setEmbeddedData("CQ1_participant_answer", answer);
});
```
```
Qualtrics.SurveyEngine.addOnPageSubmit(function() {
var answer = jQuery("#"+this.questionId+" .InputText").val();
Qualtrics.SurveyEngine.setEmbeddedData("CQ1_participant_answer", answer);
});
```
Thanks for your answer! Works perfectly!
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.