Code Monkey home page Code Monkey logo

Comments (5)

StateBarofArizona avatar StateBarofArizona commented on July 28, 2024 1

What values do I pass into this new function?

from jquery-smart-wizard.

onesinus avatar onesinus commented on July 28, 2024 1

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.

from jquery-smart-wizard.

sandipwane avatar sandipwane commented on July 28, 2024

call this function in show step callback
function fnDisableFinishButton(iCurrentStep, iFinishStep, oFinishButton) {
oFinishButton = oFinishButton || $(".actionBar .buttonFinish")
iFinishStep = iFinishStep || 3
if (oFinishButton && iCurrentStep == iFinishStep) {
oFinishButton.removeClass('buttonDisabled')
} else if (oFinishButton) {
oFinishButton.addClass('buttonDisabled')
} }`

from jquery-smart-wizard.

fcopaveltorres avatar fcopaveltorres commented on July 28, 2024

Hi,
Solution

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

    });

from jquery-smart-wizard.

ghassanhjr avatar ghassanhjr commented on July 28, 2024

you made my day

from jquery-smart-wizard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.