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*:
Best answer by TomG
Here are some things to try:
- If your code is in the addOnload function, change it to addOnReady
- Set page transition to 'none'
- Use this.hideNextButton() instead of $('NextButton').hide()
If none of those work, you can put your code inside a setTimeout function.

