Turning A Form Field Into A Drop Down With Force Response - New Survey Taking Experience | XM Community
Skip to main content

Hi folks,

I’m trying to move all of my organization surveys to the new survey taking experience. One of my surveys has a form field question with JavaScript that converts one of the fields to a dropdown. After converting it to the new survey taking experience, the dropdown no longer works. Below is the original script that used to work:

Qualtrics.SurveyEngine.addOnload(function() {
    var that=this.questionId;
    var pipe1 = this.getTextValue(6);
    var element="<select id='s6'><option></option><option value='Charter'>Charter</option><option value='Cyber'>Cyber</option><option value='District'>District</option><option value='Home School'>Home School</option><option value='Private'>Private</option></select>";
    jQuery(element).insertAfter("#"+that+" .InputText:eq(5)");
    jQuery("#"+that+" .InputText:eq(5)").hide().val(pipe1);
    jQuery("#s6").val(pipe1);
    var select1= document.getElementById("s6");
    select1.addEventListener('input', function (event) {
        jQuery("#"+that+" .InputText:eq(5)").val(jQuery("#s6 option:selected").text());
    }, false);
});

Is there a way to rewrite this so it will continue to function in the new survey taking experience with force response turned on for the whole form field question?

Thank you!

This supports ‘New Experience’. Contact me by private message if interested.