title: Data annotation on int[]
body: <p>In a ASP.NET MVC5, I'm using the chosen JS library for a multi-dropdown select. How Can I do to use Data Annotation to validate the field?</p>
  
  <p>Actually I use <code>[Required]</code> on all fields, this multi-dropdown select too, but it isn't working.</p>
  
  <p>Code:</p>
  
  <pre><code>[MinLength(1)]
  public int[] fields{ get; set; }
  </code></pre>
  
  <p>Here is my Code in the cshtml:</p>
  
  <pre><code>@Html.ListBoxFor(x =&gt; x.fields, Model.fieldsSelect, new { data_placeholder = "pholder" })
                  @Html.ValidationMessageFor(model =&gt; model.fields, "", new { @class = "text-danger" })
  </code></pre>
  
  <p>Without the plugin I currently use (chosen) there is no validation , Here is the HTML rendered without chosen:</p>
  
  <pre><code>&lt;div class="col-md-10"&gt;
                  &lt;select data-placeholder="Enter multiple fields" data-val="true" data-val-minlength="The field fieldsmust be a string or array type with a minimum length of '1'." data-val-minlength-min="1" id="fields" multiple="multiple" name="fields"&gt;
  &lt;option value="944454"&gt;WARUYFJGHIE&lt;/option&gt;
  &lt;option value="33033095"&gt;WEBJKHGJHGVHGAN&lt;/option&gt;
  &lt;/select&gt;
                  &lt;span class="field-validation-valid text-danger" data-valmsg-for="fields" data-valmsg-replace="true"&gt;&lt;/span&gt;
  
              &lt;/div&gt;
  </code></pre>
  
  <p>Validation works for all my string but not this one: when I select nothing on the form, all [Required] for strings works: an error message is apparing and submit is not hitting the controller/server, but not the [MinLength(1)]... No error message and when I fill all except [MinLength(1)], the form is submitting and error occurs in the controller/server because of null.</p>
  
  <p>Versions of JS validations:</p>
  
  <ul>
  <li>jQuery Validation Plugin - v1.11.1 - 3/22/2013</li>
  <li>jquery.validate.unobtrusive.min.js : no version (neither in the
  jquery.validate.unobtrusive..js)</li>
  </ul>