title: MVC 3 Validation - Only show error messages after lost focus or submit?
body: <p>I have setup the entities in my MVC 3 app with DataAnnotations (required, stringlength, etc) and the MVC page is showing validation error messages appropriately.  But, the error messages are shown as soon as the page loads on a new form before the user has had the chance to enter an invalid value.  </p>
  
  <p>I had used JQuery validation a few years ago and was able to only show the error messages after the user lost focus on a field or attempted to submit the form.  In fact, I think it was the default behavior.</p>
  
  <p>Is there anyway to do the same in MVC 3 using DataAnnotations?</p>
  
  <p>EDIT:  Here is the HTML</p>
  
  <pre><code>&lt;div class="form horizontal floated w50p"&gt;
  &lt;h3&gt;Billing Information&lt;/h3&gt;
  @using(Html.BeginForm()){
      &lt;div class="item"&gt;
          &lt;div class="label"&gt;
              &lt;label&gt;* First Name&lt;/label&gt;&lt;/div&gt;
          &lt;div class="value"&gt;@Html.TextBoxFor(x =&gt; x.Name)&lt;/div&gt;
          &lt;div class="value"&gt;@Html.ValidationMessageFor(x =&gt; x.Name)&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="item"&gt;
          &lt;div class="label"&gt;
              &lt;label&gt;* Address 1&lt;/label&gt;&lt;/div&gt;
          &lt;div class="value"&gt;@Html.TextBoxFor(x =&gt; x.Street1)&lt;/div&gt;
          &lt;div class="value"&gt;@Html.ValidationMessageFor(x =&gt; x.Street1)&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="item"&gt;
          &lt;div class="label"&gt;
              &lt;label&gt;Address 2&lt;/label&gt;&lt;/div&gt;
          &lt;div class="value"&gt;@Html.TextBoxFor(x =&gt; x.Street2)&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="item"&gt;
          &lt;div class="label"&gt;
              &lt;label&gt;Address 3&lt;/label&gt;&lt;/div&gt;
          &lt;div class="value"&gt;@Html.TextBoxFor(x =&gt; x.Street3)&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="item"&gt;
          &lt;div class="label"&gt;
              &lt;label&gt;City&lt;/label&gt;&lt;/div&gt;
          &lt;div class="value"&gt;@Html.TextBoxFor(x =&gt; x.City)&lt;/div&gt;
          &lt;div class="value"&gt;@Html.ValidationMessageFor(x =&gt; x.City)&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="item"&gt;
          &lt;div class="label"&gt;
              &lt;label&gt;State/Province/Region&lt;/label&gt;&lt;/div&gt;
          &lt;div class="value"&gt;@Html.TextBoxFor(x =&gt; x.StateProv)&lt;/div&gt;
          &lt;div class="value"&gt;@Html.ValidationMessageFor(x =&gt; x.StateProv)&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="item"&gt;
          &lt;div class="label"&gt;
              &lt;label&gt;Zip / Postal Code&lt;/label&gt;&lt;/div&gt;
          &lt;div class="value"&gt;@Html.TextBoxFor(x =&gt; x.PostalCode)&lt;/div&gt;
          &lt;div class="value"&gt;@Html.ValidationMessageFor(x =&gt; x.PostalCode)&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="item"&gt;
          &lt;div class="label"&gt;
              &lt;label&gt;* Contact Phone&lt;/label&gt;&lt;/div&gt;
          &lt;div class="value"&gt;@Html.TextBoxFor(x =&gt; x.ContactPhone)&lt;/div&gt;
          &lt;div class="value"&gt;@Html.ValidationMessageFor(x =&gt; x.ContactPhone)&lt;/div&gt;
      &lt;/div&gt;        &lt;input type="submit" value="Submit" /&gt;
  }
  </code></pre>