title: MVC 5 DropDownList Client Validation
body: <p>After Enabling Client Validation, Why is the DropDownList or the String Properties not being Validated client side?  Using EF 6.1, MVC 5 VS2012.</p>
  
  <p>Here is my EF Class</p>
  
  <pre><code>//------------------------------------------------------------------------------
  // &lt;auto-generated&gt;
  //     This code was generated from a template.
  //
  //     Manual changes to this file may cause unexpected behavior in your application.
  //     Manual changes to this file will be overwritten if the code is regenerated.
  // &lt;/auto-generated&gt;
  //------------------------------------------------------------------------------
  
  namespace SampleApp.Models
  {
      using System;
      using System.Collections.Generic;
  
      public partial class Business
      {
          public int BusinessKeyId { get; set; }
          public string BusinessName { get; set; }
          public string BusinessType { get; set; }
          public int ContactId { get; set; }
  
          public virtual Contact Contact { get; set; }
      }
  }
  </code></pre>
  
  <p>My Controller Actions</p>
  
  <pre><code>// GET: /Business/
  public ActionResult Index()
  {
      var businesses = _db.Businesses.Include(b =&gt; b.Contact);
      return View(businesses.ToList());
  }
  
  // GET: /Business/Create
  public ActionResult Create()
  {
      ViewBag.ContactId = new SelectList(_db.Contacts, "ContactId", "Name");
      return View();
  }
  
  // POST: /Business/Create
  [HttpPost]
  [ValidateAntiForgeryToken]
  public ActionResult Create([Bind(Include="BusinessKeyId,BusinessName,BusinessType,ContactId")] Business business)
  {
      if (ModelState.IsValid)
      {
          _db.Businesses.Add(business);
          _db.SaveChanges();
          return RedirectToAction("Index");
      }
  
      ViewBag.ContactId = new SelectList(_db.Contacts, "ContactId", "Name", business.ContactId);
      return View(business);
  }
  </code></pre>
  
  <p>And My View</p>
  
  <pre><code>@model SampleApp.Models.Business
  
  @{
      ViewBag.Title = "Create";
      Layout = "~/Views/Shared/_Layout.cshtml";
  }
  &lt;script src="~/Scripts/jquery-2.1.0.min.js"&gt;&lt;/script&gt;
  &lt;script src="~/Scripts/jquery.validate.min.js"&gt;&lt;/script&gt;
  &lt;script src="~/Scripts/jquery.validate.unobtrusive.min.js"&gt;&lt;/script&gt;
  
  
  &lt;h2&gt;Create&lt;/h2&gt;
  
  
  @using (Html.BeginForm()) 
  {
      @Html.AntiForgeryToken()
  
      &lt;div class="form-horizontal"&gt;
          &lt;h4&gt;Business&lt;/h4&gt;
          &lt;hr /&gt;
          @Html.ValidationSummary(true)
  
          &lt;div class="form-group"&gt;
              @Html.LabelFor(model =&gt; model.BusinessKeyId, new { @class = "control-label col-md-2" })
              &lt;div class="col-md-10"&gt;
                  @Html.EditorFor(model =&gt; model.BusinessKeyId)
                  @Html.ValidationMessageFor(model =&gt; model.BusinessKeyId)
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="form-group"&gt;
              @Html.LabelFor(model =&gt; model.BusinessName, new { @class = "control-label col-md-2" })
              &lt;div class="col-md-10"&gt;
                  @Html.EditorFor(model =&gt; model.BusinessName)
                  @Html.ValidationMessageFor(model =&gt; model.BusinessName)
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="form-group"&gt;
              @Html.LabelFor(model =&gt; model.BusinessType, new { @class = "control-label col-md-2" })
              &lt;div class="col-md-10"&gt;
                  @Html.EditorFor(model =&gt; model.BusinessType)
                  @Html.ValidationMessageFor(model =&gt; model.BusinessType)
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="form-group"&gt;
              @Html.LabelFor(model =&gt; model.ContactId, "ContactId", new { @class = "control-label col-md-2" })
              &lt;div class="col-md-10"&gt;
                  @Html.DropDownList("ContactId", String.Empty)
                  @Html.ValidationMessageFor(model =&gt; model.ContactId)
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="form-group"&gt;
              &lt;div class="col-md-offset-2 col-md-10"&gt;
                  &lt;input type="submit" value="Create" class="btn btn-default" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  }
  
  &lt;div&gt;
      @Html.ActionLink("Back to List", "Index")
  &lt;/div&gt;
  
  @section Scripts {
      @Scripts.Render("~/bundles/jqueryval")
  }
  </code></pre>
  
  <p>Here is a snippet of the validation where the id is only being validated</p>
  
  <p><img src="https://i.stack.imgur.com/MtjHR.png" alt="enter image description here"></p>