Question
Pulling a selected choice from a drill down menu.
I am trying to pull out the selected value in the second drop down of a drill down menu.
We are trying to pull the selected value set it as a variable then parse only the email out of the selected choice and have it pre-populate a text entry box.
I cant seem to get the selected value out of the drill down though
I have pieced this script together with my limited knowledge of JS.
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
var ddl1 = document.getElementById("QR~QID1~3");
var Selections = [];
Selections.push (ddl1);
console.log("selection: " + Selections);
var a;
var email = "";
var len = 0;
var b= 0;
for ( a = 0; a < Selections.length; a++ )
{
if (Selections[a] != 0)
{
email = Selections[a].split(" - ")[1];
email = email.trim();
jQuery("#"+this.questionId+" .InputText").val(email).attr("readonly",true);
}
}
});
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
