title: How to clear an individual Validation message with jquery
body: <p>VC5 project</p>
  
  <p>I have this TextBox and Validation message in my Razor view:</p>
  
  <blockquote>
    <p>@Html.TextBoxFor(m => m.FireSrv.Size)
    @Html.ValidationMessageFor(m => m.FireSrv.Size)</p>
  </blockquote>
  
  <p>I want to clear (not hide) just this message, I do not want to clear the entire form.</p>
  
  <p>I tried this and it doesn't work:</p>
  
  <blockquote>
    <p>$('#FireSrv_Size').find(".field-validation-valid").remove();</p>
  </blockquote>
  
  <p>FireSrv_Size is correct, it is the id of the field in the form.</p>
  
  <p>I've implemented </p>
  
  <blockquote>
    <p>IValidatableObject</p>
  </blockquote>
  
  <p>in my ViewModel.</p>
  
  <pre><code>public IEnumerable&lt;ValidationResult&gt; Validate(ValidationContext validationContext)
  {
    string em = "Size is required";
    if (HasFireSrv) { if (string.IsNullOrEmpty(FireSrv.Size)) { yield return new ValidationResult(em, new[] { "FireSrv.Size" }); } }
   ...
  </code></pre>
  
  <p>This is what is shown in View source before and after generating the validation error:</p>
  
  <pre><code> &lt;input id="FireSrv_Size" name="FireSrv.Size" type="text" value="" /&gt;
   &lt;span class="field-validation-valid" data-valmsg-for="FireSrv.Size" data-valmsg-replace="true"&gt;&lt;/span&gt;
  
   &lt;input class="input-validation-error" id="FireSrv_Size" name="FireSrv.Size" type="text" value="" /&gt;
   &lt;span class="field-validation-error" data-valmsg-for="FireSrv.Size" data-valmsg-replace="true"&gt;Size is required&lt;/span&gt;
  </code></pre>
  
  <p>How can I clear just that one validation message?</p>