title: How to redirect to another tabpanel tab when button is submited in a MVC
body: <p>I'm working on MVC application, and in one of my Views there is tab control which has three tabs, on each tab (first and second) user has to fill some data which might be seen on third tab, so for example when user fills input on first tab, he will click on another tab and user will fill input on second tab, and when user clicks Save Changes then I would like save changes to a database (by calling my method in a controller) and redirect user to a third tab</p>
  
  <p>Here is an image of how that looks on my view:</p>
  
  <p>And here is an html from my View (image above) for this:</p>
  
  <pre><code>&lt;div class="" role="tabpanel" data-example-id="togglable-tabs"&gt;
                              &lt;ul id="myTab" class="nav nav-tabs bar_tabs" role="tablist"&gt;
                                  &lt;li role="presentation" class="active"&gt;
                                      &lt;a href="#tab_content1" id="home-tab" role="tab" data-toggle="tab" aria-expanded="true"&gt;TAB 1&lt;/a&gt;
                                  &lt;/li&gt;
                                  &lt;li role="presentation" class=""&gt;
                                      &lt;a href="#tab_content2" role="tab" id="profile-tab" data-toggle="tab" aria-expanded="false"&gt;TAB 2&lt;/a&gt;
                                  &lt;/li&gt;
                                  &lt;li role="presentation" class=""&gt;
                                      &lt;a href="#tab_content3" role="tab" id="profile-tab" data-toggle="tab" aria-expanded="false"&gt;TAB 3&lt;/a&gt;
                                  &lt;/li&gt;
                              &lt;/ul&gt;
                              &lt;div id="myTabContent" class="tab-content"&gt;
                                  &lt;div role="tabpanel" class="tab-pane fade active in" id="tab_content1" aria-labelledby="home-tab"&gt;
                                      &lt;div class="col-md-6 col-sm-6"&gt;
                                          &lt;div class="form-group"&gt;
                                              //My inputs as text boxes
                                          &lt;/div&gt;
                                          &lt;div class="form-group"&gt;
                                              //My inputs as text boxes
                                          &lt;/div&gt;
                                          &lt;div class="form-group"&gt;
                                              //My inputs as text boxes
                                          &lt;/div&gt;
                                          &lt;div class="form-group"&gt;
                                             //My inputs as text boxes
                                          &lt;/div&gt;
  
                                          &lt;div class="form-group"&gt;
                                            //My inputs as text boxes 
                                          &lt;/div&gt;
                                          &lt;div class="form-group"&gt;
                                             //My inputs as text boxes 
                                          &lt;/div&gt;
                                          &lt;div class="form-group"&gt;
                                            //My inputs as text boxes 
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div role="tabpanel" class="tab-pane fade" id="tab_content2" aria-labelledby="profile-tab"&gt;
                                      &lt;div class="table-responsive"&gt;
                                          &lt;table class="table table-striped  jambo_table bulk_action"&gt;
                                              &lt;thead&gt;
                                                  &lt;tr class="headings"&gt;
                                                      &lt;th class="column-title"&gt;Name &lt;/th&gt;
                                                      &lt;th class="column-title"&gt;Title  &lt;/th&gt;
                                                  &lt;/tr&gt;
                                              &lt;/thead&gt;
                                              &lt;tbody&gt;
  
                                          &lt;/table&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div role="tabpanel" class="tab-pane fade" id="tab_content3" aria-labelledby="profile-tab"&gt;
                                      &lt;div class="row"&gt;
                                          &lt;div class="col-md-5 col-sm-12 col-xs-12"&gt;
  
                                          &lt;/div&gt;
                                          &lt;div class="col-md-7 col-sm-12 col-xs-12"&gt;
                                              &lt;div class="table-responsive"&gt;
                                                  &lt;table class="table table-striped  jambo_table bulk_action"&gt;
                                                      &lt;thead&gt;
                                                          &lt;tr class="headings"&gt;
                                                              &lt;th class="column-title"&gt;Name &lt;/th&gt;
                                                              &lt;th class="column-title"&gt;Title&lt;/th&gt;
                                                              &lt;th class="column-title"&gt;Value&lt;/th&gt;
                                                          &lt;/tr&gt;
                                                      &lt;/thead&gt;                                                       
                                                  &lt;/table&gt;
                                              &lt;/div&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                              &lt;div class="col-md-12 col-sm-12 col-xs-12"&gt;
                                  &lt;div class="form-group"&gt;
                                      &lt;div class="col-md-12"&gt;
                                          &lt;br /&gt;
                                          &lt;button type="submit" class="btn btn-warning pull-right" id="btnSaveThis"&gt;&lt;i class="fa fa-save"&gt;&lt;/i&gt; Save changes&lt;/button&gt;
  
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  </code></pre>
  
  <p>As you can see guys from a code there is only one "Save changes" button in this View, and it is submiting data to a server and saving it to a database, and after it is saved I ussualy redirected it to a Index page like this:</p>
  
  <pre><code> return RedirectToAction("Index", "Articles");
  </code></pre>
  
  <p>But now I am wondering how can I redirect user to a "TAB 3" when he is located on a TAB 2 and if he press "Save changes".</p>
  
  <p>What I did for now is next, I acctually attached on click event on my button which is submiting changes to a database, and it looks like this:</p>
  
  <pre><code>$('#btnSaveThis').click(function (e) {
              e.preventDefault();
              $('#myTab a[href="#tab_content3"]').tab('show');
          })
  </code></pre>
  
  <p>And this code above will open third tab when I 'm on second tab and if I press Save changes, but then my method which is located in a Controller wont be hitted because of this line: <code>e.preventDefault();</code></p>
  
  <p>So guys, how can I make a POST to my Controller, to save changes to a database, but also execute code from my javascript to open third tab?</p>
  
  <p>Thanks guys
  Cheers</p>