views:

17

answers:

1

I am using UI tabs and i want to validate each tab.

When I click the second tab i must validate the first tab.If tab is valid go to second tab, if tab is not valid stay to the current tab and fill in missing form elements.And so on for all my tabs.

Can anyone help me with this.

A: 

validate the form on the select event for the tab. if you return false in that event then the tab will not be changed..

as follows :

$('#example').tabs({
    select: function(event, ui) {
        return validate;// call your validation method here and return the result 
    }
});
dejavu