jQuery tabs: Post previously selected tab when opening a new one

Posted by Bjorn Thor Jonsson on Stack Overflow See other posts from Stack Overflow or by Bjorn Thor Jonsson
Published on 2010-03-31T17:26:35Z Indexed on 2010/03/31 17:33 UTC
Read the original article Hit count: 854

Filed under:
|
|
|
|

Hi

Having two forms, each in it's own jQuery UI tab, how can I post the form in the deselected tab when clicking a new tab?

This I need to do to maintain state at the server side when the user navigates between tabs.

I have looked into something like

$('#tab-container-id').bind('tabsselect', function(event, ui) {
    ...
});

but haven't found a way to get to the tab being hidden and post it's form contents.

One way to set this up would be to enclose the whole tab set inside a form element that would be submitted whenever a tab is selected but I would rather have a form inside each tab, each with it's own action (that gets bound to different Spring MVC command objects).

Thanks for any hints...

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about ui