Setting a text question response using js | XM Community
Skip to main content
Solved

Setting a text question response using js

  • November 6, 2018
  • 2 replies
  • 43 views

Forum|alt.badge.img+4
How can we set a response to a text question using JS?

Best answer by Anonymous

Hello @salimlko , Paste the below code in the js(onReady) of the text question `jQuery("#"+this.questionId+" .InputText").val("Response to text question");`

2 replies

Forum|alt.badge.img+4
  • Author
  • Level 1 ●
  • November 6, 2018
I have tried using below code but it's not working. var questionId = this.questionId; questionID.setChoiceValue(1,z.toString());

  • Answer
  • November 6, 2018
Hello @salimlko , Paste the below code in the js(onReady) of the text question `jQuery("#"+this.questionId+" .InputText").val("Response to text question");`