Tip: Choosing the active tab on a redirect
Posted: Fri Oct 14, 2005 2:43 pm
Sometimes when you hit the submit button on a tab's form you want to go back to the same tab, or to a different one other than the default.
(applies to the 0.11.2 series or later)
Here's how.
In your tab setup
then
Then in your code for handling forms.... when done
Note the empty quotes in the third parameter to Redirect....
(applies to the 0.11.2 series or later)
Here's how.
In your tab setup
Code: Select all
$active_tab = ''';
if( isset( $params['active_tab'] )
$active_tab = $params['active_tab'];
Code: Select all
echo $this->StartTabHeaders();
echo $this->StartTab('tab1','My Tab 1', ($active_tab == 'tab1'))
echo $this->StartTab('tab2','My Tab 2',($active_tab == 'tab2'));
...
Code: Select all
unset( $params['action'] ); // this shouldn't be necessary if using active svn
$params['active_tab'] = 'tab1';
$this->Redirect($id, 'defaultadmin', '', $params );