I have a text entry question in my qualtrics survey which I want to answer automatically with "hello" using JavaScript.
I added the following line to the addOnReady function to achieve this:
`jQuery("#"+this.questionId+" .InputText").attr("value", "hello");`
This code has worked in March - the text entry field was automatically filled with "hello" and "hello" was also written in the corresponding row when I exported the data. However, this line does not work anymore. The text entry field remains empty and so does the my dataset. When I inspect the text entry in the browser though, I do find that the attribute value has been set to "hello".
The following line worked in March and still works today:
`jQuery("#"+this.questionId+" .InputText").attr("placeholder", "hello");`
What did Qualtrics change that settingthe value-attribute of a text entry field doesn't do anything anymore? What do I need to change?
Page 1 / 1
Hello @nschwitter ,
Try using the below code:
`jQuery("#"+this.questionId+" .InputText").val("hello");`
Try using the below code:
`jQuery("#"+this.questionId+" .InputText").val("hello");`
Can you control the timing of when the text appears? For example, have "hello" display after the text entry question has been displayed after 10 or 15 seconds.
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.