title: Displaying twitter bootstrap alert after MVC4 form submit
body: <p>I have a very simple form in MVC 4.0, my project is based off the bootstrap3 for MVC4 VS2012 template. All I wish to do is have the user submit the form, then do some validations in my controller, and then based on what I pass back to the view, it should show a bootstrap alert(either error or success)</p>
  
  <p>I have the form wired up so that it when I click Send it correctly fires the correct action on the controller. But I'm unsure about the following thing:</p>
  
  <ol>
  <li>How do I hide the alert so it only shows after I return a result to the view.</li>
  <li>I wish to display either an error or success alert, would I do this in jQuery, through .addClass?</li>
  </ol>
  
  <p>![enter image description here][1]</p>
  
  <p>[1]: </p>
  
  <pre><code>&lt;div class="panel panel-info"&gt;
  &lt;div class="panel-heading"&gt;&lt;strong&gt;Register your interest&lt;/strong&gt;&lt;/div&gt;
  &lt;p&gt;&lt;/p&gt;
  
  &lt;div class="panel-body"&gt;
  
      &lt;form name="contactform" class="form-inline" role="form" method="post" action="/Home/Contact"&gt;
  
          &lt;div class="form-group"&gt;
              &lt;label class="text-info"&gt;Name&lt;/label&gt;
              &lt;input type="text" class="form-control" placeholder="Name"&gt;
          &lt;/div&gt;
          &lt;p&gt;&lt;/p&gt;
          &lt;div class="form-group"&gt;
              &lt;label class="text-info"&gt;Email&lt;/label&gt;
              &lt;input type="email" class="form-control" placeholder="Email"&gt;
          &lt;/div&gt;
          &lt;p&gt;&lt;/p&gt;
          &lt;div class="form-group"&gt;
              &lt;label class="text-info"&gt;Comments&lt;/label&gt;&lt;br /&gt;
              &lt;textarea class="form-control" cols="20" rows="2" style="width: 400px; height: 150px; max-height: 350px; max-width: 500px"&gt;&lt;/textarea&gt;
          &lt;/div&gt;
          &lt;p&gt;&lt;/p&gt;
  
          &lt;button id="myBtn" type="submit" value="send" class="btn btn-primary"&gt;Send&lt;/button&gt;&lt;p /&gt;
  
  
          &lt;div class="alert alert-success" &gt;             
              &lt;strong&gt;Thank you!&lt;/strong&gt; Your query has been submitted. 
          &lt;/div&gt;
  
      &lt;/form&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p></p>