Accessing and using Embedded data from Javascript | XM Community
Question

Accessing and using Embedded data from Javascript

  • 9 February 2024
  • 2 replies
  • 30 views

Badge +1

Hi,

 

I am having a bit of trouble setting a user’s input on qualtrics. I have a text box that is used to take the date of the user’s choosing and I want to set this string they type in into a variable in the Javascript editor. I tried using the piped text, but it uses it as a string itself rather than pointing to the string that the user inputted. If anyone knows how to help that would be great!


2 replies

Userlevel 6
Badge +27

We won’t be able to access the input text on same page via piped text. Assuming you are using text entry question, we can use below JS to get value entered in text box:

var s = jQuery("#"+this.questionId+" .InputText").val();

 

Badge +1

@Shashi I am using the text entry question for this! But, I tried using the line you inserted, but I could not get it to work. Any reason you think for this?

Leave a Reply