I'm trying to do some custom validation on submit for a Lightning Web Component. I'm trying to use the setErrors
method for a lightning-input-field (https://developer.salesforce.com/docs/component-library/bundle/lightning-input-field/specification) and nothing seems to be happening.
Does anyone have any examples of how I can get the error message to show or know where I can find one?
handleSubmit(events){
let f = this.template.querySelector('.myInputField');
f.setErrors('error message');
f.reportValidity();
}