how to trigger on jquery smart wizard Finish button

0 votes

Iam very new in jquery. here is jquery from smart wizard:

/ Default Properties and Events
    $.fn.smartWizard.defaults = {
        selected: 0,  // Selected Step, 0 = first step
        keyNavigation: true, // Enable/Disable key navigation(left and right keys are used if enabled)
        enableAllSteps: false,
        transitionEffect: 'fade', // Effect on navigation, none/fade/slide/slideleft
        contentURL:null, // content url, Enables Ajax content loading
        contentCache:true, // cache step contents, if false content is fetched always from ajax url
        cycleSteps: false, // cycle step navigation
        enableFinishButton: false, // make finish button enabled always
        hideButtonsOnDisabled: false, // when the previous/next/finish buttons are disabled, hide them instead?
        errorSteps:[],    // Array Steps with errors
        labelNext:'Next',
        labelPrevious:'Previous',
        labelFinish:'Finish',
        noForwardJumping: false,
        ajaxType: "POST",
        onLeaveStep: null, // triggers when leaving a step
        onShowStep: null,  // triggers when showing a step
        onFinish: null,  // triggers when Finish button is clicked
        includeFinishButton : true   // Add the finish button
    };

})(jQuery);



<script type="text/javascript">
        $(document).ready(function() {
            // Smart Wizard         
            $('#wizard').smartWizard({
                onLeaveStep: leaveAStepCallback,
                onFinish: onFinishCallback
            });

            function leaveAStepCallback(obj, context) {
                debugger;
                alert("Leaving step " + context.fromStep + " to go to step " + context.toStep);
                return validateSteps(context.fromStep); // return false to stay on step and true to continue navigation 
            }

            function onFinishCallback(objs, context) {

                debugger;
                if (validateAllSteps()) {
                    $('form').submit();
                }
            }

            // Your Step validation logic
            function validateSteps(stepnumber) {
                debugger;
                var isStepValid = true;
                // validate step 1
                if (stepnumber == 1) {
                    // Your step validation logic
                    // set isStepValid = false if has errors
                }
                // ...      
            }
            function validateAllSteps() {
                debugger;
                var isStepValid = true;
                // all step validation logic     
                return isStepValid;
            }
        });
</script>

i need some functione for onFinish, where i can send request with many parameters. how to do it?

Jul 19, 2022 in Web Development by gaurav
• 23,260 points
2,623 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Web Development

0 votes
1 answer

How to Fade In/Out multiple texts using CSS/jQuery like on Droplr?

The jQuery fadeIn() method is used to ...READ MORE

answered Jun 29, 2022 in Web Development by rajatha
• 7,680 points
1,457 views
0 votes
0 answers

How to check radio button is checked using JQuery?

I have two radio buttons in one ...READ MORE

Jun 29, 2022 in Web Development by gaurav
• 23,260 points
500 views
0 votes
0 answers

How to make notices pop up as jquery on Ruby on Rails 4

I have a user controller with the ...READ MORE

Jul 28, 2022 in Web Development by gaurav
• 23,260 points
458 views
0 votes
1 answer

how to rotate image image 3d in jquery on swipe up and swipe down

If you're not using one of the ...READ MORE

answered Aug 4, 2022 in Web Development by rajatha
• 7,680 points
1,987 views
0 votes
0 answers

How to Align a Home Button and Dropdown Menus on the Same Line in a Navigation Bar?

How to Align a Home Button and ...READ MORE

2 days ago in Web Development by Nidhi
• 4,840 points
18 views
0 votes
0 answers

How to open a modal popup on button click in Angular 8?

How to open a modal popup on ...READ MORE

1 day ago in Web Development by Nidhi
• 4,840 points
4 views
0 votes
1 answer

jQuery AJAX submit form

There is a simple input mentioned below ...READ MORE

answered Feb 8, 2022 in Java by Soham
• 9,710 points
1,726 views
0 votes
1 answer

Microsoft CDN for jQuery or Google CDN?

You should absolutely use the Google CDN ...READ MORE

answered Jun 22, 2022 in Web Development by rajatha
• 7,680 points
681 views
0 votes
1 answer

How to use jquery with asp.net ajax?

If you weren't aware, Microsoft is planning ...READ MORE

answered Oct 15, 2018 in IoT (Internet of Things) by Annie97
• 2,160 points
766 views
0 votes
1 answer

Is 'sparkline' a method?

I suggest you to check 2 things That jquery.sparkline.js is actually ...READ MORE

answered Nov 9, 2018 in Apache Spark by Frankie
• 9,830 points
1,302 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP