title: How can I programmatically trigger client side validation set up by a Razor view?
body: <p>I have a little Ajax application where I use Razor views to initially generated HTML form segments that I later read and write from with knockout.js. Although I am doing no non-Ajax action requests, I use Razor to generate the HTML so I enjoy automatic generation of jQuery Validation attributes. E.g. in my single page, I render a hidden form like this:</p>
  
  <pre><code>&lt;section id="person-detail"&gt;
      @Html.Action("EditPartial", "Person")
  &lt;/section&gt;
  </code></pre>
  
  <p>The <code>EditPartial</code> action returns a partial view that looks a lot like this:</p>
  
  <pre><code>@using (Html.BeginForm())
  {
      &lt;fieldset&gt;
          @Html.HiddenFor(model =&gt; model.Id, new { data_bind = "value: id" })
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.FirstName)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.TextBoxFor(model =&gt; model.FirstName, new { data_bind = "value: firstName" })
              @Html.ValidationMessageFor(model =&gt; model.FirstName)
          &lt;/div&gt;
          &lt;p&gt;            
              &lt;a href="#" data-bind="click: save"&gt;Update&lt;/a&gt;&amp;nbsp;&amp;nbsp;
              &lt;a href="#" data-bind="click: delete"&gt;Delete&lt;/a&gt;
          &lt;/p&gt;
      &lt;/fieldset&gt;
  }
  </code></pre>
  
  <p>Because I'm never actually posting the form, and due to some unknowns, despite all properties on my <code>Person</code> model being marked with the <code>Required</code> attribute, I see no sign of client side validation. What must I do to trigger this validation when my save button is clicked?</p>