fail to hide "next" button | XM Community
Skip to main content

I'm trying to hide the "next" button until the user clicks another button that I've created. I'm able to do this with another survey of mine, using the code below. But when I copy that code to the new survey, the "next" button refuses to hide. I suspect there must be other properties of the survey that are interfering with my code, but I can't figure out what. My survey has some other behaviors, like random assignment to blocks, and assigning embedded data fields, but so does the survey that's working correctly.
Here's my javascript that works correctly in another survey:
$('NextButton').hide();
jQuery("#button").click(function() {
 jQuery("#infodiv").toggle();
$('NextButton').toggle();
});

And here's the corresponding HTML code that's also working correctly in the other survey*:

Here are some things to try:

  1. If your code is in the addOnload function, change it to addOnReady

  2. Set page transition to 'none'

  3. Use this.hideNextButton() instead of $('NextButton').hide()

If none of those work, you can put your code inside a setTimeout function.


https://community.qualtrics.com/XMcommunity/discussion/comment/44831#Comment_44831Hooray, #3 worked!
My survey was already compliant with your first two recommendations, but the third one fixed the problem with a simple copy/paste.
I'm ashamed to admit how many hours I already spent on this, so thank you so much for your tremendous help, TomG!!


Leave a Reply