Sachin
Sachin

Reputation: 11

Jquery ui tab-wise validation

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.

Upvotes: 1

Views: 502

Answers (1)

Ahmed Aman
Ahmed Aman

Reputation: 2393

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 
    }
});

Upvotes: 1

Related Questions