title: Integer Validation not working properly with Data Annotation
body: <p>I have come across this issue a few times now and I can't seem to get the exact answer as to why it is happening.</p>
  
  <p>I have a field that needs to validate the input to only accept integers.</p>
  
  <p>I have the data model property as below:</p>
  
  <pre><code>[Display(Name = "Customer ID")]
  [Required]
  [Range(0, int.MaxValue, ErrorMessage="Must be integer")]
  public int CustId { get; set; }
  </code></pre>
  
  <p>I have the HTML as below. It was generated by the MVC Scaffolding </p>
  
  <pre><code>@using (Html.BeginForm()) 
  {
   @Html.ValidationSummary(true)
  
   &lt;div class="form-group"&gt;
      @Html.LabelFor(model =&gt; model.CustId, new { @class = "control-label col-md-2" })
      &lt;div class="col-md-10"&gt;
          @Html.EditorFor(model =&gt; model.CustId, new { htmlAttributes = new { @class = "form-control" }, })
          @Html.ValidationMessageFor(model =&gt; model.CustId)
      &lt;/div&gt;
   &lt;/div&gt;
  
  ...
  </code></pre>
  
  <p>The textbox accepts integers with no error message. When I entered letters/alphabets, the textbox will simply clear its field and shows no error message. However, if I entered numerics followed by letters eg. 1234abcd the textbox will be validated correctly and even show the correct error message. </p>
  
  <p>I am using ASP.NET MVC 5 and I have JQuery Validation and Unobstructive turned on.</p>
  
  <p>I tried using <a href="http://dataannotationsextensions.org/" rel="nofollow">DataAnnotationExtension</a> by adding Integer attribute and I still got the same problem.</p>
  
  <p>It has been pointed out that it is possibly caused by a bug(s) within the JQuery Validation. What exactly is the bug/problem?</p>