How to obtain value from single line text box using javascript? | XM Community
Skip to main content
Solved

How to obtain value from single line text box using javascript?

  • August 7, 2019
  • 1 reply
  • 361 views

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); } });

Best answer by als100027

I solved it this way: this.questionclick = function(event,element){ alert('ID: ' +element.value);

1 reply

  • Author
  • Answer
  • August 7, 2019
I solved it this way: this.questionclick = function(event,element){ alert('ID: ' +element.value);