title: use jquery validation plugin in mvc form page
body: <p>I'm trying to use jquery validation plugin on a mvc form page to check certain required fields. However, the error messages that i am getting are the validation rules of my view model. Does anyone happen to know why the rules that i set in jquery.validate is not displayed? </p>
  
  <p>here is my view model </p>
  
  <pre><code>public class ViewModelA
  {
      [Required(ErrorMessageResourceName = "invalid name")]
      public string ClientName { get; set; }}
  </code></pre>
  
  <p>and here is my mvc web form (assumming jquery validation unobtrusive library is imported correctly)</p>
  
  <pre><code>@model ViewModelA
  @using (Html.BeginForm(null, null, FormMethod.Post, new { id="AAA"})){
              @Html.LabelFor(model =&gt; model.ClientName, new { @class = "text-bold " })
              @Html.ValidationMessageFor(model =&gt; model.ClientName)
              @Html.TextBoxFor(model =&gt; model.ClientName, @class = "input-text required" })
  
  }
  </code></pre>
  
  <p>in my jquery controller, i am trying to validate</p>
  
  <pre><code>    $("#AAA").validate({
        onsubmit: false,
        rules: {
          ClientName: {
            required: true
          },
        },
        messages: {
          ClientName: {
            required: 'validation message from jquery'
          },
        }
      });
  </code></pre>
  
  <p>but this message can't be displayed. i think i'm using jquery validation library correctly. But the viewmodel somehow reset my html or js which cause the FE validation not working. I have also tried deleting that @Html.ValidationMessageFor. Although the error messages from viewmodel is not showing, the FE error message does not show either  </p>