title: mvc model validation required not working on all fields
body: <p>I'm working in ASP.NET MVC 4 and I have the problem that my model validation isn't working correctly. For some reason not all my required fields have to be filled in.</p>
  
  <p>Here's my model:</p>
  
  <pre><code>public class MovieModel
      {
          public int Id { get; set; }
          [Required]
          public string Name { get; set; }
          public DateTime ReleaseDate { get; set; }
          [Required]
          public string Genre { get; set; }
          [Required]
          public decimal Price { get; set; }
  
          public virtual ICollection&lt;RoleInMovie&gt; RoleInMovie { get; set; }
      }
  </code></pre>
  
  <p>Here's the View: </p>
  
  <pre><code>@using (Html.BeginForm())
  {
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;label&gt;Name:&lt;/label&gt;&lt;/td&gt;
              &lt;td&gt;@Html.EditorFor(m =&gt; m.Name)&lt;/td&gt;
              &lt;td&gt;@Html.ValidationMessageFor(m =&gt; m.Name)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;label&gt;Genre:&lt;/label&gt;&lt;/td&gt;
              &lt;td&gt;@Html.EditorFor(m =&gt; m.Genre)&lt;/td&gt;
              &lt;td&gt;@Html.ValidationMessageFor(m =&gt; m.Genre)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;label&gt;Price:&lt;/label&gt;&lt;/td&gt;
              &lt;td&gt;@Html.EditorFor(m =&gt; m.Price)&lt;/td&gt;
              &lt;td&gt;@Html.ValidationMessageFor(m =&gt; m.Price)&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
      &lt;button type="submit"&gt;Submit&lt;/button&gt;
  }
  </code></pre>
  
  <p>And here's my action:</p>
  
  <pre><code>[HttpPost]
          public ActionResult Add(MovieModel model)
          {
              if(ModelState.IsValid)
              {
                  return RedirectToAction("Index");
              }
              return View();
          }
  </code></pre>
  
  <p>Now here's the thing: as soon as I enter only a price, modelstate.isvalid becomes true. When hovering over my model, it sais both name and genre are null. Ofcourse they are required, but the validation doesn't work.
  Also, the validationmessagefor only works on price.</p>
  
  <p>I hope I'm not overlooking something too ridiculous. Thanks for the help!</p>