Skip to content Skip to sidebar Skip to footer

Jquery UI Tabs: Next And Previous Enable/disable Based On Select Boxes

I am currently working with Jquery UI tabs that I have only operating with next/previous buttons(this will force the user to go through the tabs in order). In my first tab I have a

Solution 1:

Ok, this is untested. Only change the tab on next/previous click, if you are not on the first tab (1) or the really last tab exist and an option (except the neutral) is choosen (2).

$('.next-tab, .prev-tab').click(function() {
    var tabIndex = $(this).attr("rel");
    if (
        /*(1)*/ $('#tabs').tabs('option', 'selected') > 0 ||
        /*(2)*/ ($('.update.last').length > 0 && parseInt($('.update.last').val(), 10) > 0)
    ) {
        $tabs.tabs('enable', tabIndex)
            .tabs('select', tabIndex)
            .tabs("option","disabled", [0, 1]);
    }
    return false;
});

Good luck and see you tomorrow :-)


Post a Comment for "Jquery UI Tabs: Next And Previous Enable/disable Based On Select Boxes"