how could I display a popup window when respondents click on text | XM Community
Skip to main content

how could I display a popup window when respondents click on text

  • November 22, 2022
  • 2 replies
  • 3962 views

Forum|alt.badge.img+1

Hi,
I am new to Qualtrics. I like to display a popup window when respondents click on certain text on the survey. It is like a definition or more information need to show to respondents on certain terms or text on the survey. I use the javascript function like that below:

function open_new_window1a(event) {
  event = event || window.event;
  if (event.preventDefault) {
    event.preventDefault();
  } else {
    event.returnValue = false;
  }
   
new_window = open("","my_new_window","width=360,height=420,left=45,top=150, scrollbars=1");
new_window.focus();
new_window.document.open();

new_window.document.write("");
new_window.document.write("The Lifetime Capital Gains Exemption (LCGE) helps to spare businesses from paying taxes on all or part of the profit they earn when selling a small business, a farm property or a fishing property. Business owners may seek to use this option when selling their business as source of income for retirement. ");
new_window.document.write("
");
new_window.document.write("
");
new_window.document.write("");
new_window.document.close();
}

on the text for click, I use the code like that:

LCGE

but Qualtrics could not use document.write and said it is invalid javascript syntax. Do anyone have a code that could share what I need to accomplish this task?

Thanks,



2 replies

Deepak
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+46
  • November 22, 2022

Forum|alt.badge.img+1

I actually made a YouTube video about this because I was encountering this a lot myself.  My video shows a few approaches, but if you skip to the 2rd one, it demonstrates code that triggers some pop-up text when someone clicks on a word embedded with a hyperlink.