Dynamically display a radio button based on selection from another radio button in a Likert matrix | XM Community
Skip to main content

Dear XM community,
We are trying to display a statement dynamically based on click of a radio button in a Likert matrix.
For example, if someone clicks "yes" for a statement, it should show an additional statement in the matrix, but if they click no it should turn off the display for the additional statement. This should happen dynamically to the radio button click action without needing to click the next button.
Could you provide the example code to accomplish this?
Thank you and kind regards,
Nagesh

You will need to hide it through JS if it's in the same question/row. That could be accomplished using simple css('display','none') but you will need to find the proper class before applying.
Example:
jQuery('.SingleAnswer').find('.q-radio').eq(2).css('display','none')



https://community.qualtrics.com/XMcommunity/discussion/comment/47924#Comment_47924Dear grahulp5,
Thank you for your kind response. Pardon my ignorance as I am a novice to both jQuery and Qualtrics. I can infer that the above line finds the second radio button and sets it's display to none, but could you provide a bit more elaborate example? For example in the screenshot below there are two statements and three choices.
Screen Shot 2022-07-21 at 8.36.30 PM.pngThe Statement2 and it's options should be displayed only when Yes is clicked (not submitted, but just clicked) for Statement1. If the user clicks on Maybe or No for Statement1 then Statement2 should not appear. The user should be able to do this as many times as they want.
Also I could see three functions in the JavaScript section of the question and these do not seem to be capturing click events.
Screen Shot 2022-07-21 at 8.36.14 PM.pngCould you kindly provide a fully working example?
Thank you and kind regards,
Nagesh


Leave a Reply