Lightning:Input - Hide (Reset) Field Level Error message Enabled by using showHelpMessageIfInvalid()
If you really wanted to hide error messages you could do something like this:
Component:
<div>
<lightning:input label="First Name" aura:id="firstName" required="true"/>
<lightning:button onclick="{!c.hideErrors}">Hide Errors</lightning:button>
</div>
Controller:
hideErrors : function(component, event, helper) {
var el = component.find("firstName");
$A.util.removeClass(el, "slds-has-error"); // remove red border
$A.util.addClass(el, "hide-error-message"); // hide error message
}
Style:
.THIS .hide-error-message > .slds-form-element__help {
.THIS .hide-error-message > .slds-form-element > .slds-form-element__help {
display: none;
}
But the internal DOM structure and class names of base components are subject to change so this isn't a totally robust solution.