Get the answer from other question on the same page | XM Community
Skip to main content
Question

Get the answer from other question on the same page

  • May 25, 2022
  • 3 replies
  • 64 views

Is there a way to capture the answer from another question that is on the same page? I created a modal inside a hidden form that will appear if the answer from the other question has been met.

3 replies

bgooldfed
Level 4 ●●●●
Forum|alt.badge.img+25
  • Level 4 ●●●●
  • May 26, 2022

Hi Kennedy_Isip_KantarKennedy_Isip,
Can you use display logic to solve this? eg: display Q3 if the answer to Q2 = "Red".
When setting display logic there is also an "In Page" option which will allow the survey to continually check whether your display condition in the same page is true/false, and then respond accordingly.
Best of luck!


Hi bgooldfed,
I need the jquery/javascript condition considering that I'm triggering a pop-up form. The idea is that when Q1 answers "Yes", there's a pop-up form asking for consent from the respondent.


bgooldfed
Level 4 ●●●●
Forum|alt.badge.img+25
  • Level 4 ●●●●
  • June 1, 2022

Hi Kennedy_Isip,
So when the user clicks the "Yes" option, your modal appears, correct? If so, something like this should suffice:
//replace #yes with the ID of the "Yes" option
//replace #modal with the ID of the modal on your page
jQuery("#yes").click(function(){
    jQuery("#modal").modal();
  });
Good luck!