title: How to redirect to tabbed page which is set as not active
body: <p>I have a tabbed form:</p>
  
  <pre><code>    &lt;ul class="tab-links"&gt;
        &lt;li class="active"&gt;&lt;a href="#tab1"&gt;Pending&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#tab2"&gt;All&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  
    &lt;div class="tab-content"&gt;
       &lt;div id="tab1" class="tab active"&gt;
            //contents here
       &lt;/div&gt;
       &lt;div id="tab2" class="tab"&gt;
            //contents here
       &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>every time I refresh the page, it always redirect to <code>tab1 (which is pre-selected as active)</code> </p>
  
  <p>My problem is, at tab2, when user submits the form and if it has an error, I want to redirect it to tab2 but since tab1 is the pre selected active tab. It always go to tab 1.</p>
  
  <p>are there any way to redirect it to other tab other than the pre-selected tab?</p>
  
  <p>PS: I use alert box to notify and redirect my user if there's an error occured.</p>
  
  <pre><code>if(error){
     echo "&lt;script&gt;
       alert('Please state your reason!');
       window.location.href='home_admin.php#tab2';
           &lt;/script&gt;"; 
  </code></pre>
  
  <p>TIA</p>