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

Setting a text question response using js

  • Nov 6, 2018 11:54 AM UTC
  • 2 replies
  • 71 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");`
View original

2 replies

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

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