[Solved] Script to hide “Next” button until required question AND required answer is selected


I’m trying to build a script that hides the next button if 1) a single-select question is present, and 2) the question is answered a certain way.

To give it some context, I am asking some respondents (not all, though) “Are you done?”. If the question is there, I want them to answer “Yes” before going to the next page. If they answer “No”, I want the “Next” button to be hidden until they answer “Yes”.

So essentially, I not only want to require a question (if the question is present), but I want to require an answer as well.


Nick Wicks selected answer

    Best answer


    Hey Dominic, thanks for the help. We ended up figuring out a good way to do it using client-side JS:

    var addListeners = function(){
    $(“#sgE-[dev ID number of radio button you want to hide from]”).on(“change”, function(e){
    $(“#sgE-[dev ID number of radio button you want to show from] “).on(“change”, function(e){

    if( $.isReady ) { addListeners() } else { $(addListeners); }

    Thanks again, though.

    Dominic Sharpe commented

      You might start with something like this:

      $SG(“# id of button that is clicked to show Next”).click(function(){
      $SG(“# id of button that is clicked to hide Next”).click(function(){

      There is probably a more efficient way of doing this (I’m no developer). Also, missing here is the if statement for evaluating if the question is on the page, but hopefully it’s at least somewhat helpful!


      Dominic Sharpe answered


        Question stats

        • Active
        • Views11017 times
        • Answers2 answers
        • Followers1 follower