Guidance for testing Qualtrics Javascript in JSFiddle | XM Community
Skip to main content

Hi All,
Please could someone point to me in the right direction as to how you can transplant relatively generic JS code from a Qualtrics envirnoment into something like JS Fiddle. JS Fiddle is alot easier to test out functionality I've found but so far my attempt to get it working in JSFiddle has proven difficult.


My first step is to take a copy of the HTML element (I've tried copying the html form the element just under #document
image.png

I've ensured that JQuery is included in the setup of JSFiddle.
image.png
My next step is I most likely need to transplant the Qualtrics specific functions to something more generic
eg. Qualtrics.SurveyEngine.addOnReady(function(){
What do I need to change to make the function run in JSFiddle? Can anyone share a simple JS fiddle to show what elements you change to test things out?
or, have I totally misunderstood how you use JSFiddle?
Is there something I can use that is better?

For reference, I am setting up a Question that asks the responder their email address in a form field. They then have to reconfirm it in the next text box. Whilst they are typing I have build some JS code that confirms whether both fields match and whether it's a valid email address (ie include an @ character). I am just trying to work out the various If else conditions and wanted to use JS fiddle to test things out more quickly and check for any missing brackets etc.

Thanks
Rod Pestell

This will not be possible. The best you can do is to develop your code for particular elements (such as input boxes) externally and then come back to Qualtrics to test it.


Leave a Reply