title: Immediately validate email fields on client side
body: <p>I have the following property in my view model:</p>
  
  <pre><code>[EmailAddress]
  [DataType(DataType.EmailAddress)]
  public string Email { get; set; }
  </code></pre>
  
  <p>And render this with the following razor view:</p>
  
  <pre><code>@Html.LabelFor(m =&gt; m.Email)
  @Html.EditorFor(m =&gt; m.Email)
  @Html.ValidationMessageFor(m =&gt; m.Email)
  </code></pre>
  
  <p>This produces the following html output (see <code>type="email"</code>, which is what I want):</p>
  
  <pre><code>&lt;input data-val="true" data-val-email="The Email field is not a valid e-mail address." id="Email" name="Email" type="email" value=""&gt;
  </code></pre>
  
  <p>I also have <code>ClientValidationEnabled</code> and <code>UnobtrusiveJavaScriptEnabled</code> set to <code>true</code>. The validation for required etc. works as expected. But the validation for this email field is not triggered immediately after changing a character in the input field or after focus another input field.</p>
  
  <p>First of all, my browser gives the message that it's not a valid email address. But when I enter <code>sfsdf@sdfsfd</code>, my browser (Chrome) detects it as a valid email address and then the email validator from ASP.NET MVC says that it's not a valid format. But the ASP.NET validator is triggered only when i hit the submit button (also the browser validation is only triggered on submit, but this is not a problem because I will disable the browser validation anyway).</p>
  
  <p>When I use <code>@Html.TextBoxFor()</code> instead of <code>@Html.EditorFor()</code> it produces the following markup (with <code>type="text"</code>):</p>
  
  <pre><code>&lt;input data-val="true" data-val-email="The Email field is not a valid e-mail address." id="Email" name="Email" type="text" value=""&gt;
  </code></pre>
  
  <p>And now, the validation is triggered immediately when changing any character in the inputfield or focus another one. By I need to have the <code>type="email"</code>.</p>
  
  <p>Is it possible to force the validation immediately also on email fields?</p>