On Feb 15, 5:34 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Yes, the idea of saving the selected tab in a variable will do nicely. > > Just for posterity, I wanted to include that the line > > var selected = $tabs.data('selected.ui-tabs'); > > is causing a JS error, "$tabs is not defined." > > Thanks, - Dave
Why is that...? Have you modified the code? It basically looks like this: var $tabs = $('#foo').tabs(); var selected = $tabs.data('selected.ui-tabs'); By the way, you could just write a one liner and completely remove the need for another variable: var selected = $('#foo').tabs().bind('select.ui-tabs', function(e, ui) { if (!selected) { // short for selected == 0 return validateForm( $('#tabcontent div.ui-tabs- container:visible form')[0] ); }).bind('show.ui-tabs', function(e, ui) { selected = ui.options.selected; }).data('selected.ui-tabs'); --Klaus