How to obtain value from single line text box using javascript? | XM Community
Skip to main content
Hi thanks for helping me out.

I am trying to obtain the value from a single line text box using this.getTextValue().

What am I doing wrong?



Qualtrics.SurveyEngine.addOnReady(function()

{

/*Place your JavaScript here to run when the page is fully displayed*/

this.questionclick = function(event,element){

//alert('ID: ' +element.id);



var answer = this.getTextValue()

alert(answer);

}

});
I solved it this way:

this.questionclick = function(event,element){

alert('ID: ' +element.value);

Leave a Reply