Disable Finish button for jQuery Smart Wizard 4












0















I have a problem on disabling the "Finish" button on jQuery Smart Wizard 4. The example given in the site has the button enabled by default.



It should have the Finish button disabled by default and should enable only once it reaches the last step. How should I disable and enable the button?



Thank you very much.










share|improve this question























  • did you tried something or search something?

    – Arijit Mukherjee
    Jan 2 '18 at 13:35











  • Yeah. I added this code .addClass('disabled') to the <button>. It disabled the button but still clickable... and still cannot be enabled.

    – Genes Molina
    Jan 2 '18 at 13:55








  • 1





    I finally solved the problem myself.:) I added a class name .addClass('finish_button') and command $(".finish_button").prop("disabled", true); at the last line inside $(document).ready(function(). I also knew now how to enable the button by class.

    – Genes Molina
    Jan 2 '18 at 14:57
















0















I have a problem on disabling the "Finish" button on jQuery Smart Wizard 4. The example given in the site has the button enabled by default.



It should have the Finish button disabled by default and should enable only once it reaches the last step. How should I disable and enable the button?



Thank you very much.










share|improve this question























  • did you tried something or search something?

    – Arijit Mukherjee
    Jan 2 '18 at 13:35











  • Yeah. I added this code .addClass('disabled') to the <button>. It disabled the button but still clickable... and still cannot be enabled.

    – Genes Molina
    Jan 2 '18 at 13:55








  • 1





    I finally solved the problem myself.:) I added a class name .addClass('finish_button') and command $(".finish_button").prop("disabled", true); at the last line inside $(document).ready(function(). I also knew now how to enable the button by class.

    – Genes Molina
    Jan 2 '18 at 14:57














0












0








0








I have a problem on disabling the "Finish" button on jQuery Smart Wizard 4. The example given in the site has the button enabled by default.



It should have the Finish button disabled by default and should enable only once it reaches the last step. How should I disable and enable the button?



Thank you very much.










share|improve this question














I have a problem on disabling the "Finish" button on jQuery Smart Wizard 4. The example given in the site has the button enabled by default.



It should have the Finish button disabled by default and should enable only once it reaches the last step. How should I disable and enable the button?



Thank you very much.







jquery smart-wizard






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 2 '18 at 13:25









Genes MolinaGenes Molina

138




138













  • did you tried something or search something?

    – Arijit Mukherjee
    Jan 2 '18 at 13:35











  • Yeah. I added this code .addClass('disabled') to the <button>. It disabled the button but still clickable... and still cannot be enabled.

    – Genes Molina
    Jan 2 '18 at 13:55








  • 1





    I finally solved the problem myself.:) I added a class name .addClass('finish_button') and command $(".finish_button").prop("disabled", true); at the last line inside $(document).ready(function(). I also knew now how to enable the button by class.

    – Genes Molina
    Jan 2 '18 at 14:57



















  • did you tried something or search something?

    – Arijit Mukherjee
    Jan 2 '18 at 13:35











  • Yeah. I added this code .addClass('disabled') to the <button>. It disabled the button but still clickable... and still cannot be enabled.

    – Genes Molina
    Jan 2 '18 at 13:55








  • 1





    I finally solved the problem myself.:) I added a class name .addClass('finish_button') and command $(".finish_button").prop("disabled", true); at the last line inside $(document).ready(function(). I also knew now how to enable the button by class.

    – Genes Molina
    Jan 2 '18 at 14:57

















did you tried something or search something?

– Arijit Mukherjee
Jan 2 '18 at 13:35





did you tried something or search something?

– Arijit Mukherjee
Jan 2 '18 at 13:35













Yeah. I added this code .addClass('disabled') to the <button>. It disabled the button but still clickable... and still cannot be enabled.

– Genes Molina
Jan 2 '18 at 13:55







Yeah. I added this code .addClass('disabled') to the <button>. It disabled the button but still clickable... and still cannot be enabled.

– Genes Molina
Jan 2 '18 at 13:55






1




1





I finally solved the problem myself.:) I added a class name .addClass('finish_button') and command $(".finish_button").prop("disabled", true); at the last line inside $(document).ready(function(). I also knew now how to enable the button by class.

– Genes Molina
Jan 2 '18 at 14:57





I finally solved the problem myself.:) I added a class name .addClass('finish_button') and command $(".finish_button").prop("disabled", true); at the last line inside $(document).ready(function(). I also knew now how to enable the button by class.

– Genes Molina
Jan 2 '18 at 14:57












3 Answers
3






active

oldest

votes


















0














Try the option enableFinishButton inside the smartWizard.



Eg.:



$('#wizard').smartWizard({
enableFinishButton: false
});





share|improve this answer































    0














    Hei,



    I just found this solutions,
    just add this simple code in every step in wizard



    if($('button.sw-btn-next').hasClass('disabled')){
    $('.sw-btn-group-extra').show(); // show the button extra only in the last page
    }else{
    $('.sw-btn-group-extra').hide();
    }


    Here Is The Full Code :



    $("#smartwizard").on("showStep", function(e, anchorObject, stepNumber, stepDirection) {
    if($('button.sw-btn-next').hasClass('disabled')){
    $('.sw-btn-group-extra').show(); // show the button extra only in the last page
    }else{
    $('.sw-btn-group-extra').hide();
    }

    });


    The Explanation is so simple,showStep function handle every step in wizard ( from step 1 to 2, etc )
    Then we just need to check is button with class btn-next(class next button) has disabled class, as we know the next button disabled when the page is last.



    Hope this help.






    share|improve this answer































      0














      Here's an example modal with the buttons as requested.
      https://github.com/amard33p/jq-smartwizard-modal



      Taking https://github.com/techlab/SmartWizard/blob/master/examples/smartwizard-modal.html as an example.

      Add three buttons to the modal footer:



          <div class="modal-footer">
      <button class="btn btn-secondary" id="prev-btn" type="button">Previous</button>
      <button class="btn btn-secondary" id="next-btn" type="button">Next</button>
      <button class="btn btn-primary" id="finish-btn" type="submit">Finish</button>
      </div>


      and edit the js logic to show/hide the buttons:



              $("#smartwizard").on("showStep", function(e, anchorObject, stepNumber, stepDirection, stepPosition) {
      if(stepPosition === 'first'){
      $("#prev-btn").addClass('disabled');
      $("#finish-btn").hide();
      }else if(stepPosition === 'final'){
      $("#next-btn").hide();
      $("#finish-btn").show();
      }else{
      $("#finish-btn").hide();
      $("#next-btn").show();
      $("#prev-btn").removeClass('disabled');
      }
      });





      share|improve this answer


























      • yeah, it's fine now. One last detail though; when you link your own websites, tools, and similar, you need to add disclosure that it is your repo. See the help center for more info

        – Zoe
        Jan 18 at 18:58











      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f48061870%2fdisable-finish-button-for-jquery-smart-wizard-4%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      Try the option enableFinishButton inside the smartWizard.



      Eg.:



      $('#wizard').smartWizard({
      enableFinishButton: false
      });





      share|improve this answer




























        0














        Try the option enableFinishButton inside the smartWizard.



        Eg.:



        $('#wizard').smartWizard({
        enableFinishButton: false
        });





        share|improve this answer


























          0












          0








          0







          Try the option enableFinishButton inside the smartWizard.



          Eg.:



          $('#wizard').smartWizard({
          enableFinishButton: false
          });





          share|improve this answer













          Try the option enableFinishButton inside the smartWizard.



          Eg.:



          $('#wizard').smartWizard({
          enableFinishButton: false
          });






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 23 '18 at 18:45









          João Pedro RaldiJoão Pedro Raldi

          547




          547

























              0














              Hei,



              I just found this solutions,
              just add this simple code in every step in wizard



              if($('button.sw-btn-next').hasClass('disabled')){
              $('.sw-btn-group-extra').show(); // show the button extra only in the last page
              }else{
              $('.sw-btn-group-extra').hide();
              }


              Here Is The Full Code :



              $("#smartwizard").on("showStep", function(e, anchorObject, stepNumber, stepDirection) {
              if($('button.sw-btn-next').hasClass('disabled')){
              $('.sw-btn-group-extra').show(); // show the button extra only in the last page
              }else{
              $('.sw-btn-group-extra').hide();
              }

              });


              The Explanation is so simple,showStep function handle every step in wizard ( from step 1 to 2, etc )
              Then we just need to check is button with class btn-next(class next button) has disabled class, as we know the next button disabled when the page is last.



              Hope this help.






              share|improve this answer




























                0














                Hei,



                I just found this solutions,
                just add this simple code in every step in wizard



                if($('button.sw-btn-next').hasClass('disabled')){
                $('.sw-btn-group-extra').show(); // show the button extra only in the last page
                }else{
                $('.sw-btn-group-extra').hide();
                }


                Here Is The Full Code :



                $("#smartwizard").on("showStep", function(e, anchorObject, stepNumber, stepDirection) {
                if($('button.sw-btn-next').hasClass('disabled')){
                $('.sw-btn-group-extra').show(); // show the button extra only in the last page
                }else{
                $('.sw-btn-group-extra').hide();
                }

                });


                The Explanation is so simple,showStep function handle every step in wizard ( from step 1 to 2, etc )
                Then we just need to check is button with class btn-next(class next button) has disabled class, as we know the next button disabled when the page is last.



                Hope this help.






                share|improve this answer


























                  0












                  0








                  0







                  Hei,



                  I just found this solutions,
                  just add this simple code in every step in wizard



                  if($('button.sw-btn-next').hasClass('disabled')){
                  $('.sw-btn-group-extra').show(); // show the button extra only in the last page
                  }else{
                  $('.sw-btn-group-extra').hide();
                  }


                  Here Is The Full Code :



                  $("#smartwizard").on("showStep", function(e, anchorObject, stepNumber, stepDirection) {
                  if($('button.sw-btn-next').hasClass('disabled')){
                  $('.sw-btn-group-extra').show(); // show the button extra only in the last page
                  }else{
                  $('.sw-btn-group-extra').hide();
                  }

                  });


                  The Explanation is so simple,showStep function handle every step in wizard ( from step 1 to 2, etc )
                  Then we just need to check is button with class btn-next(class next button) has disabled class, as we know the next button disabled when the page is last.



                  Hope this help.






                  share|improve this answer













                  Hei,



                  I just found this solutions,
                  just add this simple code in every step in wizard



                  if($('button.sw-btn-next').hasClass('disabled')){
                  $('.sw-btn-group-extra').show(); // show the button extra only in the last page
                  }else{
                  $('.sw-btn-group-extra').hide();
                  }


                  Here Is The Full Code :



                  $("#smartwizard").on("showStep", function(e, anchorObject, stepNumber, stepDirection) {
                  if($('button.sw-btn-next').hasClass('disabled')){
                  $('.sw-btn-group-extra').show(); // show the button extra only in the last page
                  }else{
                  $('.sw-btn-group-extra').hide();
                  }

                  });


                  The Explanation is so simple,showStep function handle every step in wizard ( from step 1 to 2, etc )
                  Then we just need to check is button with class btn-next(class next button) has disabled class, as we know the next button disabled when the page is last.



                  Hope this help.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jun 13 '18 at 8:35









                  Onesinus SautOnesinus Saut

                  76112




                  76112























                      0














                      Here's an example modal with the buttons as requested.
                      https://github.com/amard33p/jq-smartwizard-modal



                      Taking https://github.com/techlab/SmartWizard/blob/master/examples/smartwizard-modal.html as an example.

                      Add three buttons to the modal footer:



                          <div class="modal-footer">
                      <button class="btn btn-secondary" id="prev-btn" type="button">Previous</button>
                      <button class="btn btn-secondary" id="next-btn" type="button">Next</button>
                      <button class="btn btn-primary" id="finish-btn" type="submit">Finish</button>
                      </div>


                      and edit the js logic to show/hide the buttons:



                              $("#smartwizard").on("showStep", function(e, anchorObject, stepNumber, stepDirection, stepPosition) {
                      if(stepPosition === 'first'){
                      $("#prev-btn").addClass('disabled');
                      $("#finish-btn").hide();
                      }else if(stepPosition === 'final'){
                      $("#next-btn").hide();
                      $("#finish-btn").show();
                      }else{
                      $("#finish-btn").hide();
                      $("#next-btn").show();
                      $("#prev-btn").removeClass('disabled');
                      }
                      });





                      share|improve this answer


























                      • yeah, it's fine now. One last detail though; when you link your own websites, tools, and similar, you need to add disclosure that it is your repo. See the help center for more info

                        – Zoe
                        Jan 18 at 18:58
















                      0














                      Here's an example modal with the buttons as requested.
                      https://github.com/amard33p/jq-smartwizard-modal



                      Taking https://github.com/techlab/SmartWizard/blob/master/examples/smartwizard-modal.html as an example.

                      Add three buttons to the modal footer:



                          <div class="modal-footer">
                      <button class="btn btn-secondary" id="prev-btn" type="button">Previous</button>
                      <button class="btn btn-secondary" id="next-btn" type="button">Next</button>
                      <button class="btn btn-primary" id="finish-btn" type="submit">Finish</button>
                      </div>


                      and edit the js logic to show/hide the buttons:



                              $("#smartwizard").on("showStep", function(e, anchorObject, stepNumber, stepDirection, stepPosition) {
                      if(stepPosition === 'first'){
                      $("#prev-btn").addClass('disabled');
                      $("#finish-btn").hide();
                      }else if(stepPosition === 'final'){
                      $("#next-btn").hide();
                      $("#finish-btn").show();
                      }else{
                      $("#finish-btn").hide();
                      $("#next-btn").show();
                      $("#prev-btn").removeClass('disabled');
                      }
                      });





                      share|improve this answer


























                      • yeah, it's fine now. One last detail though; when you link your own websites, tools, and similar, you need to add disclosure that it is your repo. See the help center for more info

                        – Zoe
                        Jan 18 at 18:58














                      0












                      0








                      0







                      Here's an example modal with the buttons as requested.
                      https://github.com/amard33p/jq-smartwizard-modal



                      Taking https://github.com/techlab/SmartWizard/blob/master/examples/smartwizard-modal.html as an example.

                      Add three buttons to the modal footer:



                          <div class="modal-footer">
                      <button class="btn btn-secondary" id="prev-btn" type="button">Previous</button>
                      <button class="btn btn-secondary" id="next-btn" type="button">Next</button>
                      <button class="btn btn-primary" id="finish-btn" type="submit">Finish</button>
                      </div>


                      and edit the js logic to show/hide the buttons:



                              $("#smartwizard").on("showStep", function(e, anchorObject, stepNumber, stepDirection, stepPosition) {
                      if(stepPosition === 'first'){
                      $("#prev-btn").addClass('disabled');
                      $("#finish-btn").hide();
                      }else if(stepPosition === 'final'){
                      $("#next-btn").hide();
                      $("#finish-btn").show();
                      }else{
                      $("#finish-btn").hide();
                      $("#next-btn").show();
                      $("#prev-btn").removeClass('disabled');
                      }
                      });





                      share|improve this answer















                      Here's an example modal with the buttons as requested.
                      https://github.com/amard33p/jq-smartwizard-modal



                      Taking https://github.com/techlab/SmartWizard/blob/master/examples/smartwizard-modal.html as an example.

                      Add three buttons to the modal footer:



                          <div class="modal-footer">
                      <button class="btn btn-secondary" id="prev-btn" type="button">Previous</button>
                      <button class="btn btn-secondary" id="next-btn" type="button">Next</button>
                      <button class="btn btn-primary" id="finish-btn" type="submit">Finish</button>
                      </div>


                      and edit the js logic to show/hide the buttons:



                              $("#smartwizard").on("showStep", function(e, anchorObject, stepNumber, stepDirection, stepPosition) {
                      if(stepPosition === 'first'){
                      $("#prev-btn").addClass('disabled');
                      $("#finish-btn").hide();
                      }else if(stepPosition === 'final'){
                      $("#next-btn").hide();
                      $("#finish-btn").show();
                      }else{
                      $("#finish-btn").hide();
                      $("#next-btn").show();
                      $("#prev-btn").removeClass('disabled');
                      }
                      });






                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Jan 18 at 19:04

























                      answered Jan 18 at 18:40









                      Gh0sTGh0sT

                      1046




                      1046













                      • yeah, it's fine now. One last detail though; when you link your own websites, tools, and similar, you need to add disclosure that it is your repo. See the help center for more info

                        – Zoe
                        Jan 18 at 18:58



















                      • yeah, it's fine now. One last detail though; when you link your own websites, tools, and similar, you need to add disclosure that it is your repo. See the help center for more info

                        – Zoe
                        Jan 18 at 18:58

















                      yeah, it's fine now. One last detail though; when you link your own websites, tools, and similar, you need to add disclosure that it is your repo. See the help center for more info

                      – Zoe
                      Jan 18 at 18:58





                      yeah, it's fine now. One last detail though; when you link your own websites, tools, and similar, you need to add disclosure that it is your repo. See the help center for more info

                      – Zoe
                      Jan 18 at 18:58


















                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f48061870%2fdisable-finish-button-for-jquery-smart-wizard-4%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Liquibase includeAll doesn't find base path

                      How to use setInterval in EJS file?

                      Petrus Granier-Deferre