title: How to reset custom validation errors when using editform in blazor razor page
body: <p>I have an editform using an editcontext:</p>
  
  <pre><code>    &lt;EditForm OnValidSubmit="HandleValidSubmit" EditContext="_editContext" Context="auth"&gt;
        &lt;DataAnnotationsValidator /&gt;
        &lt;input type="time" @bind-value="_foodTruck.EndDelivery" @onkeydown="@(q=&gt;ResetValidation("EndDelivery"))" &gt;
          &lt;ValidationMessage For="() =&gt; _foodTruck.EndDelivery" /&gt;
        &lt;input type="time" @bind-value="_foodTruck.StartDelivery" @onkeydown="@(q=&gt;ResetValidation("StartDelivery"))" &gt;
          &lt;ValidationMessage For="() =&gt; _foodTruck.StartDelivery" /&gt;
        &lt;input class="btn btn-default" type="submit" value="save" /&gt;
      &lt;/EditForm&gt;
  </code></pre>
  
  <p>I do some custom validations in HandleValidSubmit:</p>
  
  <pre><code>EditContext _editContext = new EditContext(_foodTruck);
  private async void HandleValidSubmit()
  {
    var messageStore = new ValidationMessageStore(_editContext);
    if (_foodTruck.StartDelivery &gt;= _foodTruck.EndDelivery)
    {
      messageStore.Add(_editContext.Field("EndDelivery"), "Bad time entered");
      _editContext.NotifyValidationStateChanged();
    }
   if (!_editContext.Validate()) return;
  }
  </code></pre>
  
  <p>What now happens is that my custom error ("bad time entered") is displayed at the right position. The only issue is: That error does not disappear when I change the value. So HandleValidSubmit is never called again if I click onto the submit button.</p>
  
  <p>I also tried emptying the validationerrors when modifying the fields:</p>
  
  <pre><code>   protected void ResetValidation(string field)
      {
          var messageStore = new ValidationMessageStore(_editContext);        
          messageStore.Clear(_editContext.Field(field));
          messageStore.Clear();
          _editContext.NotifyValidationStateChanged();
      }
  </code></pre>
  
  <p>This is called by <code>onkeydown</code>. But that doesn't seem to have an effect, either. The Errormessage does not disappear and so <code>HandleValidSubmit</code> isn't called either.</p>