Reputation: 15
I have a view where i used bootstrap tabpanels. On the first tab(active one), i have the home message. On the second one i have a form with 3 input fields and a submit button. In the model function where i validate the data for those fields, I output form validation errors or success message, and after I reload the view.
$data['table'] = $this -> model_admin -> get_users();
$data['title'] = 'Administrator';
$this -> load -> view('admin_view', $data);
What i want to do is to manage, after i click submit button to reload the view, but with the second tab being active. Like I could load instead of ..../admin_view.php, ..../admin_view.php#add.
Upvotes: 0
Views: 130
Reputation: 7977
you need to select the tab using bootstrap tab method
$('#myTab li:eq(1) a').tab('show') // Select second tab (0-indexed)
Upvotes: 2