title: Why DataType.Password validates only on server-side?
body: <p>I have model as </p>
  
  <pre><code>[Required]
  [EmailAddress]
  [Remote("EmailValidation", "Account", ErrorMessage = "{0} already has an account, please enter a different email address.")]
  [Display(Name = "Email")]
  public string Email { get; set; }
  
  [Required]
  [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
  [DataType(DataType.Password)]
  [Display(Name = "Password")]
  public string Password { get; set; }
  
  [DataType(DataType.Password)]
  [Display(Name = "Confirm password")]
  [System.ComponentModel.DataAnnotations.Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
  public string ConfirmPassword { get; set; }
  </code></pre>
  
  <p>and form for registration as:</p>
  
  <pre><code>&lt;form id="registrationForm"&gt;
      @Html.AntiForgeryToken()
      @Html.ValidationSummary(true, String.Empty, new { @class = "text-danger text-center" })
      @Html.HiddenFor(m =&gt; m.ForModal, new { @Value = true })
      &lt;div class="form-group text-center"&gt;
          &lt;div class="input-group margin-top-10 margin-bottom-5"&gt;
              &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-user"&gt;&lt;/i&gt;&lt;/span&gt;
              @Html.TextBoxFor(m =&gt; m.Email, new { @class = "form-control", placeholder = "Email", @readonly = "readonly" })
          &lt;/div&gt;
          @Html.ValidationMessageFor(m =&gt; m.Email, null, new { @class = "text-danger" })
          &lt;div class="input-group margin-top-10 margin-bottom-5"&gt;
              &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-lock"&gt;&lt;/i&gt;&lt;/span&gt;
              @Html.PasswordFor(m =&gt; m.Password, new { @class = "form-control", placeholder = "Password" })
          &lt;/div&gt;
          @Html.ValidationMessageFor(m =&gt; m.Password, null, new { @class = "text-danger" })
          &lt;div class="input-group margin-top-10 margin-bottom-5"&gt;
              &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-lock"&gt;&lt;/i&gt;&lt;/span&gt;
              @Html.PasswordFor(m =&gt; m.ConfirmPassword, new { @class = "form-control", placeholder = "Confirm Password" })
          &lt;/div&gt;
          @Html.ValidationMessageFor(m =&gt; m.ConfirmPassword, null, new { @class = "text-danger" })
      &lt;/div&gt;
      &lt;div class="text-right"&gt;
          &lt;button type="submit" class="btn-u btn-u-orange btn-u-wide" title="Join"&gt;Join&lt;/button&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>When i type short password - validation fires, when i type confirPassword different as Password - validation fires, but when i type only digits as <code>123456</code> nothing happens on client-side, just on server-side, after all i get error.</p>
  
  <p><a href="https://i.imgur.com/jY8bymy.png" rel="nofollow noreferrer">http://i.imgur.com/jY8bymy.png</a> (link for screenshot)</p>
  
  <p>Why i can get validation DataType.Password on client-side?</p>
  
  <hr>
  
  <p>As i search about such problem in internet, i just get solution like <code>use Html.PasswordFor or Html.EditorFor instead of Html.TextBoxFor</code>.</p>