title: Setting an active button after a POST operation using PHP and bootstrap
body: <p>I'd appreciate your help with this!</p>
  
  <p>Here is my bootstrap HTML code:</p>
  
  <pre><code>        &lt;div class="form-group centered"&gt;
              &lt;input type="submit" class="btn btn-primary btn-block" name="login" value="Log In"&gt;&lt;/input&gt;
          &lt;/div&gt;
  
          &lt;div class="centered"&gt;
            &lt;div class="form-group btn-group" data-toggle="buttons"&gt;
              &lt;label class="btn btn-default active"&gt;
                &lt;input type="radio" id="app" value="app" name="dashboard"/&gt;Application
              &lt;/label&gt;
              &lt;label class="btn btn-default"&gt;
                &lt;input type="radio" id="setup" value="setup" name="dashboard"/&gt;Setup
              &lt;/label&gt;
            &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>I would like to add some logic that after the "Log In" button is selected, the "active" class on the label is retained properly.  </p>
  
  <p>Example:</p>
  
  <ol>
  <li>Setup is selected</li>
  <li>The user clicks login</li>
  <li>The password is wrong so the user is thrown back to the same log in form</li>
  <li>This time the form has the setup button "active" automatically</li>
  </ol>
  
  <p>I tried playing around with the following within the app input type:</p>
  
  <pre><code>&lt;?php if($_POST['dashboard'] == "app") { echo checked="\"checked\""; } ?&gt;
  </code></pre>
  
  <p>I now realize, however, that this button group does not work like a regular radio button, and I probably need to toggle the class on the labels somehow.</p>
  
  <p>Thanks in advance for your help!</p>