Javascript - Browser discrepancy? | XM Community
Skip to main content
Question

Javascript - Browser discrepancy?

  • January 14, 2022
  • 0 replies
  • 12 views

We tested this JavaScript to maintain selections in the drop downs. It works in safari, but not in chrome. Does anyone has an idea what may cause this?


Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
 

 
});

Qualtrics.SurveyEngine.addOnReady(function()
{
console.log(jQuery("#"+this.questionId+" select").find("option:eq(0)").text() );
console.log(jQuery("#"+this.questionId+" select").find("option:eq(0)").text() === "");

if ( jQuery("#"+this.questionId+" select").find("option:eq(0)").text() === "")
{ /*Place your JavaScript here to run when the page is fully displayed*/
//jQuery("#"+this.questionId+" sewlect").find("option:eq(0)").text("Select Region").attr("selected","disabled",true);
}
});


Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
});