title: MVC5 jQuery client side validation not working
body: <p>I have an MVC view model which I would like to validate in the client.  I have read lots of posts on here about the order of the libraries, but I have mirrored those suggestions and still am unable to get the validation working.  On form submit I reach the <code>Customer/CreateCustomer</code> controller method without any validation.  The web.config parameters appear to be set correctly (both relevant values set to true) in the root and the Views folder.</p>
  
  <p>I am using MVC5 with Visual Studio 2013.</p>
  
  <p>Here is my ViewModel:</p>
  
  <pre><code>public class CreateCustomerVm
  {
      [Display(Name = "Customer Name")]
      [Required]
      public string Name { get; set; }
  }
  </code></pre>
  
  <p>Here is my view:</p>
  
  <pre><code>@using (Html.BeginForm("CreateCustomer", "Customer"))
  {
      @Html.ValidationSummary(true, "", new {@class = "text-danger"})
      @Html.AntiForgeryToken()
      &lt;div class="form-horizontal"&gt;
          &lt;div class="form-group"&gt;
          @Html.LabelFor(model =&gt; model.Name, htmlAttributes: new {@class = "control-label col-md-2"})
          &lt;div class="col-md-10"&gt;
              @Html.EditorFor(model =&gt; model.Name, new {htmlAttributes = new {@class = "form-control"}})
              @Html.ValidationMessageFor(model =&gt; model.Name, "", new {@class = "text-danger"})
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;input class="btn btn-primary" type="submit" value="Create"/&gt;
  }
  </code></pre>
  
  <p>Rendered section:</p>
  
  <pre><code>&lt;form action="/Customer/CreateCustomer" method="post"&gt;    
      &lt;input name="__RequestVerificationToken" type="hidden" value="rSLp5Rwtq9rqwwrAs8UN_CsgPbXEVG_enkISIhWrkXOokprATgbRcpPNk7o6F6EaxD-9I92f7kAr7TGTFPZe0pUSZ5Rfrz8CoP3ef8-lqhXUhSVAaX7PkmmURR1XcaXQ0" /&gt;
  &lt;div class="form-horizontal"&gt;
      &lt;div class="form-group"&gt;
          &lt;label class="control-label col-md-2" for="Name"&gt;Customer Name&lt;/label&gt;
          &lt;div class="col-md-10"&gt;
          &lt;input class="form-control text-box single-line" data-val="true" data-val-required="The Customer Name field is required." id="Name" name="Name" type="text" value="BBC-TV" /&gt;
          &lt;span class="field-validation-valid text-danger" data-valmsg-for="Name" data-valmsg-replace="true"&gt;&lt;/span&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>In my _layout page i have this at the bottom:</p>
  
  <pre><code>@Scripts.Render("~/bundles/jquery")
  @Scripts.Render("~/bundles/jqueryval")
  @Scripts.Render("~/bundles/bootstrap")
  @RenderSection("scripts", required: false)
  </code></pre>
  
  <p>Finally my BundleConfig:</p>
  
  <pre><code>        bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                      "~/Scripts/jquery.form.js"
                      ));
          bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                      "~/Scripts/jquery.validate*"
                      ));
  
          bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
                    "~/Scripts/bootstrap.js",
                    "~/Scripts/respond.js"));
  </code></pre>