alosatriani
alosatriani

Reputation: 17

select tab JQuery and unselect

I'll try to be as posible specific with my problem:

When i am in my web page, i have already selected one tab, so i'm trying to validate that the user doesn't change from one tab if my actual tab it is not validated or processed (in example a form capture). So in the event of the click of the other tabs i'm inserting the following code:

$("#aTab0").click(function() {
    if(!validation){
        var $tabs=$(".tabs").tabs(); 
        $tabs.tabs('select', 0);
        return;
    }               
});

And it's ok, it changes again to the actual tab BUT the style of the TAB clicked has changed.. i want it to remain un-clicked..

An idea of what i want is if i could stop the event of the other(s) tab being clicked..

PLEASE HELP! I need somebody.. =P

THANKS in advance!

Upvotes: 0

Views: 242

Answers (2)

Nowshath
Nowshath

Reputation: 842

$(".tabs").tabs("option", "selected", 0);

Upvotes: 0

nikeaa
nikeaa

Reputation: 1047

Change "return;" to "return false;", that should do it. Returning "false" in an event handling function should stop the event from processing.

Upvotes: 1

Related Questions