<script type="text/javascript">

    jQuery('#demo-bv-wz').bootstrapWizard({
        tabClass		    : 'wz-steps',
        nextSelector	    : '.next',
        previousSelector	: '.previous',
        onTabClick          : function(tab, navigation, index) {
            return false;
        },
        onInit : function(){
            jQuery('#demo-bv-wz').find('.finish').hide().prop('disabled', true);
        },
        onTabShow: function(tab, navigation, index) {
            var $total = navigation.find('li').length;
            var $current = index+1;
            var $percent = ($current/$total) * 100;
            var wdt = 100/$total;
            var lft = wdt*index;

            jQuery('#demo-bv-wz').find('.progress-bar').css({width:wdt+'%',left:lft+"%", 'position':'relative', 'transition':'all .5s'});

            // If it's the last tab then hide the last button and show the finish instead
            if($current >= $total) {
                jQuery('#demo-bv-wz').find('.next').hide();
                jQuery('#demo-bv-wz').find('.finish').show();
                jQuery('#demo-bv-wz').find('.finish').prop('disabled', false);
            } else {
                jQuery('#demo-bv-wz').find('.next').show();
                jQuery('#demo-bv-wz').find('.finish').hide().prop('disabled', true);
            }
        },
        onNext: function(){
            isValid = null;
            jQuery('#demo-bv-wz-form').bootstrapValidator('validate');


            if(isValid === false)return false;
        }
    });

</script>	