When required fields are missing in lightning-record-edit-form
does it call any javascript method when clicked on submit button? I checked 'onsubmit'
and 'onerror'
it didn't call either of them. How can i call a javascript method if any required fields are missing in the lightning-record-edit-form when a user clicks on submit btn.
Example
<template>
<div class="slds-p-bottom_large slds-p-left_large" style="width:500px">
<lightning-record-edit-form object-api-name="Account">
<lightning-messages></lightning-messages>
<lightning-input-field required field-name="CustomField__c">
</lightning-input-field>
<lightning-button type="submit"
name="submit"
label="Create Account">
</lightning-button>
</lightning-record-edit-form>
</div>
</template>
Say CustomField__c is not provided and we click on submit button it should call certain js method.
Thanks