title: asp.net mvc client side validation not working?
body: <p>For some reason my client side validation does not seem to be working:</p>
  
  <p>Here is my html:</p>
  
  <pre><code>@using (Html.BeginForm("Create", "Home", FormMethod.Post))
  {
  
  &lt;hr /&gt;
  
  @Html.ValidationSummary(true)
  &lt;hr /&gt;
  
  &lt;p&gt;
      &lt;label&gt;Select Client_ID: &lt;/label&gt;
      &lt;span class="field"&gt;
          &lt;select name="clientId" id="clientId"&gt;
              @foreach (var item in Model.ClientId)
              {
                  &lt;option value="@item"&gt;@item&lt;/option&gt;
              }
          &lt;/select&gt;
      &lt;/span&gt;
  &lt;/p&gt;
  
  &lt;p&gt;
      &lt;label&gt;@Html.LabelFor(model =&gt; model.UserModel.name)&lt;/label&gt;
      &lt;span class="field"&gt;
          @Html.EditorFor(model =&gt; model.UserModel.name)
      &lt;/span&gt;
      @Html.ValidationMessageFor(model =&gt; model.UserModel.name)
  
  &lt;/p&gt;
  
  &lt;p&gt;
      &lt;label&gt;@Html.LabelFor(model =&gt; model.UserModel.password)&lt;/label&gt;
      &lt;span class="field"&gt;
          @*&lt;input name="password" id="password" type="password" /&gt;*@
          @Html.EditorFor(model =&gt; model.UserModel.password)
      &lt;/span&gt;
      @Html.ValidationMessageFor(model =&gt; model.UserModel.password)
  &lt;/p&gt;
  
  &lt;p&gt;
      &lt;label&gt;@Html.LabelFor(model =&gt; model.UserModel.email)&lt;/label&gt;
      &lt;span class="field"&gt;
          @*&lt;input name="email" id="email" type="email" /&gt;*@
          @Html.EditorFor(model =&gt; model.UserModel.email)
      &lt;/span&gt;
      @Html.ValidationMessageFor(model =&gt; model.UserModel.email)
  &lt;/p&gt;
  
  &lt;p&gt;
      &lt;label&gt;Select: &lt;/label&gt;
      &lt;span class="field"&gt;
          &lt;select name="accessLevel" id="accessLevel"&gt;
              &lt;option value="3"&gt;Company&lt;/option&gt;
              &lt;option value="5"&gt;End-User&lt;/option&gt;
          &lt;/select&gt;
      &lt;/span&gt;
  &lt;/p&gt;
  
  &lt;input type="submit" value="Submit" /&gt;
  </code></pre>
  
  <p>Here is my model:</p>
  
  <pre><code> public class CreateUserModel
  {
      [Required]
      [Display(Name = "Client_ID")]
      public string clientId { get; set; }
  
      [Required(ErrorMessage = "A name is required")]
      [MaxLength(20), MinLength(2, ErrorMessage = "Name must be 2 character or more")]
      [Display(Name = "Name")]
      public string name { get; set; }
  
  
      [Display(Name = "Email Address")]
      [Required(ErrorMessage = "Email is Required")]
      [RegularExpression(@"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" +
                          @"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" +
                          @".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$",
                          ErrorMessage = "Email is not valid")]
      public string email { get; set; }
  
      [Required]
      [MaxLength(20), MinLength(6, ErrorMessage = "Password Must be 6 or more chataters long")]
      [Display(Name = "Password")]
      public string password { get; set; }
  
      [Required]
      public int accessLevel { get; set; }
  }
  </code></pre>
  
  <p>and I do have client side enabled in the webconfig:</p>
  
  <pre><code> &lt;appSettings&gt;
  &lt;add key="webpages:Version" value="3.0.0.0" /&gt;
  &lt;add key="webpages:Enabled" value="false" /&gt;
  &lt;add key="ClientValidationEnabled" value="true" /&gt;
  &lt;add key="UnobtrusiveJavaScriptEnabled" value="true" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>{EDIT} added rendered html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8" /&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
  &lt;title&gt;Home Page - My ASP.NET Application&lt;/title&gt;
  &lt;link href="/Content/bootstrap.css" rel="stylesheet"/&gt;
  &lt;link href="/Content/site.css" rel="stylesheet"/&gt;
  
  &lt;script src="/Scripts/modernizr-2.6.2.js"&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;script src="/Scripts/jquery.validate.js"&gt;&lt;/script&gt;
  &lt;div class="jumbotron"&gt;
  &lt;h1&gt;Add Users to the website&lt;/h1&gt;
  &lt;/div&gt;
  &lt;form action="/Home/Create" method="post"&gt;    &lt;hr /&gt;
  &lt;hr /&gt;
  
  &lt;p&gt;
      &lt;label for="UserModel_name"&gt;Name&lt;/label&gt;
      &lt;span class="field"&gt;
          &lt;input type="text" name="name" /&gt;
      &lt;/span&gt;
      &lt;span class="field-validation-valid" data-valmsg-for="UserModel.name" data-valmsg-replace="true"&gt;&lt;/span&gt;
  
  &lt;/p&gt;
  &lt;p&gt;
      &lt;label for="UserModel_password"&gt;Password&lt;/label&gt;
      &lt;span class="field"&gt;
          &lt;input name="password" id="password" type="password" /&gt;
      &lt;/span&gt;
      &lt;span class="field-validation-valid" data-valmsg-for="UserModel.password" data-valmsg-replace="true"&gt;&lt;/span&gt;
  &lt;/p&gt;
  &lt;p&gt;
      &lt;label for="UserModel_email"&gt;Email Address&lt;/label&gt;
      &lt;span class="field"&gt;
          &lt;input name="email" id="email" type="email" /&gt;
      &lt;/span&gt;
      &lt;span class="field-validation-valid" data-valmsg-for="UserModel.email" data-valmsg-replace="true"&gt;&lt;/span&gt;
  &lt;/p&gt;
  &lt;p&gt;
      &lt;label&gt;Select: &lt;/label&gt;
      &lt;span class="field"&gt;
          &lt;select name="accessLevel" id="accessLevel"&gt;
              &lt;option value="3"&gt;Company&lt;/option&gt;
              &lt;option value="5"&gt;End-User&lt;/option&gt;
          &lt;/select&gt;
      &lt;/span&gt;
  &lt;/p&gt;
  &lt;input type="submit" value="Submit" /&gt;
   &lt;/form&gt;
      &lt;hr /&gt;
      &lt;footer&gt;
          &lt;p&gt;&amp;copy; 2014 - My ASP.NET Application&lt;/p&gt;
      &lt;/footer&gt;
  &lt;/div&gt;
  
  &lt;script src="/Scripts/jquery-2.1.0.js"&gt;&lt;/script&gt;
  
  &lt;script src="/Scripts/bootstrap.js"&gt;&lt;/script&gt;
  </code></pre>
  
  
  
  <p>
  </p>