Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically change Jquery tab focus

I'm using a pretty simple implementation of the JQuery Tabs UI element. There is a form in the first tab that I am trying to have load the second tab with the onsubmit event. In ActionScript, I could use:

tabBar.selectedIndex = n;

Where selectedIndex is the tab number that has focus. Is there a way to get this done in Jquery?

like image 958
smulholland2 Avatar asked Oct 04 '12 02:10

smulholland2


1 Answers

UPDATE Since jQuery UI 1.9

The select method has been deprecated in favor of just updating the active option.

You should replace all calls to the select method with calls to the option method to change the active option.

// Activate the third panel
$( "#tabs" ).tabs( "option", "active", 2 );
like image 115
Etienne Desgagné Avatar answered Sep 27 '22 19:09

Etienne Desgagné