Skip to content Skip to sidebar Skip to footer

How To Enable The Second Tab After The Completion Of The First Tab Validation

I have tab with the following fields

Solution 1:

In this example the input submit has the class submit. I also changed the tab ids (see fiddle)

FIDDLE http://jsfiddle.net/Spokey/2aQ2g/54/

$('.submit').click(function (e) {
    e.preventDefault(); //prevent from submission and do script instead
    //validation ....
    //if validation is okay, do below
    var nexttab = parseInt($(this).parent().next().attr('id').match(/\d+/g), 10);
    $('#tabs').tabs("enable", nexttab).tabs("select", nexttab);
    $('input[name="tabs-'+nexttab+'"]').removeAttr('disabled').prop('checked', true);
});

Post a Comment for "How To Enable The Second Tab After The Completion Of The First Tab Validation"