Solved
How do I get data output from HTML?
I have added HTML with JavaScript in the HTML view of a descriptive text question. As part of the question two number fields are displayed and have values automatically set when the user moves a circle in the question. I need to store the final values in these two fields as part of my survey data (I am guessing as embedded data). Could anyone help me with how to do this? I am not sure how/where to reference these fields in the JavaScript.
I tried to paste the code I used here but it is too long.
Best answer by KimothiSaurabh
@MelissaKough17 - Not sure what html and javascript code you have but you can use below code to show list of states as drop down in text box.
Code to put in javascript:-
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
jQuery('input[id*='+this.questionId+']').attr("list","statelist")
});
In question html put the state list as below:-
<datalist id="statelist">
<option value="Alabama">
<option value="Alaska">
<option value="Arizona">
<option value="California">
<option value="Colorado">
</datalist>
This is how it will show list:-
!
There is a drawback of this approach, it will not force respondent to choose from drop down and respondent is free to type in anything because it is text type question. To avoid this you can update javascript and validate typed texts against the list.
There is a drawback of this approach, it will not force respondent to choose from drop down and respondent is free to type in anything because it is text type question. To avoid this you can update javascript and validate typed texts against the list.Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
