Thanks a lotSolved
How to get answer into embedded data while on the same page
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
Thanks a lotBest answer by TomG
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);
});
```
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
