Clearing Validation Errors On Client Side.

I process my form fields using jQuery. Sometimes I need to clear value of a field which was marked as wrong when validating before. After clearing value the field value is valid, but error CSS is still remaining. Now I use this code but IMHO it’s a hack:




var data=["name", "address","phone1", "phone2", "email", "invoice"];

$.each(data, function(index, value) {

  $("#Customer_" + value).val("");

  $("#Customer_" +value).closest('div').removeClass().addClass("row");  

  $("#Customer_" +value + "_em_").text("");

  $("#Customer_" +value + "_em_").hide("");            

});	



Is there any documented feature to clear errors of given field on client side?

I see something similiar here, starting line 173:

http://code.google.com/p/yii/source/browse/trunk/framework/web/js/source/jquery.yiiactiveform.js?r=3530#213