title: How do I force Razor to check validation on TextBox in JavaScript
body: <p>I have a field called ACTIVITY_NAME which I have defined as such:</p>
  
  <pre><code>[Required(AllowEmptyStrings = false, ErrorMessage = "Acitivity Name is Required.")]
  [StringLength(255)]
      public string ACTIVITY_NAME { get; set; }
  </code></pre>
  
  <p>I setup my textbox to render it front-end like this:</p>
  
  <pre><code>@Html.TextBoxFor(m =&gt; m.EditActivity.ACTIVITY_NAME, new { @id = "ActivityName", @class = "width400", placeholder = Localization.ActivityName })
  @Html.ValidationMessageFor(m =&gt; m.EditActivity.ACTIVITY_NAME)
  </code></pre>
  
  <p>When the form is submited, the following JS handler is fired:</p>
  
  <pre><code>    $('#AddTaskActivity').click(function (evt) {
          $('#activityModal').modal('hide');
          evt.preventDefault();
          var formData = $('#ActivityForm').serialize();
          CreateActivity(formData);
      });
  </code></pre>
  
  <p>So basically, this would prevent the default handler, and the validation would not fire.  I didn't write this code, but I would like to add validation.  How do I force fire the validation in the handler before it post to server?  </p>