Getting TypeError: Action failed: [component.find(...).filter is not a function] in below code
isFormValid: function (component) {
return (component.find('requiredField'))
.filter(function (i) {
var value = i.get('v.value');
console.log('Emailissue' + value);
return !value || value == '' || value.trim().length === 0;
})
.map(function (i) {
return i.get('v.fieldName');
});
},
Do you display the field(s) conditionally? Wrapper in
<aura:if isTrue=...>
tag maybe? Yourfind
returned a single record with thataura:id
(so there's no "filter" on it, it's a single object, not an array) or it haven't found anything at all.Go to setup -> debug mode, enable it for yourself and add
debugger;
to this code (or add a watch/breakpoint from the browser's F12 console)