Click question text to click next button | XM Community
Skip to main content

Hi Folks,
If I knew javascript better I'd probably have the answer by now:
I'd like to create a question like Oppenheimer's instructional manipulation check:
imc.PNG
I'd like a page not to have a next/previous button (I've figured out how to do that), and a question.
To continue with the survey I'd like the respondent to need to click text in the question (such as hyperlinked text).
I've been trying to teach myself javascript and google search for code and while I feel I'm close I just can't but it together.
I can hide the previous and next arrows, and make hyperlinked text appear as normal text. I'm just having a hard time getting clicking the text to trigger going to the next page.
Thanks!
Best wishes,
Bill

Suppose you have placed your "Continue" in an anchor tag, you can just add an onclick attribute there:
continue

Alternatively, you can add this afterwards using JS:
document.getElementById("#continue").onclick = function () {document.getElementById('NextButton').click()}


Works like a charm!
Thanks ahmedA!


Dear ahmedA,
So here's what's happened.
The page works just as I want it to. But when I go to the next page nothing happens. There is no next button (I'd like the next button back for the rest of the survey) and when I choose a response - nothing happens.
So here's the html code you suggested
html.pngand here's the js to hide the buttons
js.pngCan you help me out with this? Do I need to unhide the next button on the next page?
Best wishes,
Bill


No you don't need to unhide the buttons on the next page. Check the JS of the question on that page, perhaps there's one which is hiding the next button or maybe you've added to the CSS.
If nothing like that is there, then unhide it, but I would be very careful with that survey, testing it extensively before sending it out. Because, it's doing something that it shouldn't be.


Leave a Reply